mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-14 19:29:50 +08:00
28 lines
743 B
Go
28 lines
743 B
Go
/*
|
|
* This file is subject to the terms and conditions defined in
|
|
* file 'LICENSE.md', which is part of this source code package.
|
|
*/
|
|
|
|
package fonts
|
|
|
|
import (
|
|
"github.com/unidoc/unidoc/pdf/core"
|
|
"github.com/unidoc/unidoc/pdf/internal/textencoding"
|
|
)
|
|
|
|
// Font represents a font which is a series of glyphs. Character codes from PDF strings can be
|
|
// mapped to and from glyphs. Each glyph has metrics.
|
|
type Font interface {
|
|
Encoder() textencoding.TextEncoder
|
|
SetEncoder(encoder textencoding.TextEncoder)
|
|
GetGlyphCharMetrics(glyph string) (CharMetrics, bool)
|
|
ToPdfObject() core.PdfObject
|
|
}
|
|
|
|
// CharMetrics represents width and height metrics of a glyph.
|
|
type CharMetrics struct {
|
|
GlyphName string
|
|
Wx float64
|
|
Wy float64
|
|
}
|