1 Star 0 Fork 0

coodder / unipdf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
font.go 610 Bytes
一键复制 编辑 原始数据 按行查看 历史
jhonm 提交于 2023-08-07 15:31 . init
package fonts
import (
"fmt"
"gitee.com/coodder/unipdf/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
GetRuneMetrics(r rune) (CharMetrics, bool)
}
// CharMetrics represents width and height metrics of a glyph.
type CharMetrics struct {
Wx float64
Wy float64 // TODO(dennwc): none of code paths sets this to anything except 0
}
func (m CharMetrics) String() string {
return fmt.Sprintf("<%.1f,%.1f>", m.Wx, m.Wy)
}
Go
1
https://gitee.com/coodder/unipdf.git
git@gitee.com:coodder/unipdf.git
coodder
unipdf
unipdf
v1.2.0

搜索帮助

53164aa7 5694891 3bd8fe86 5694891