mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
text/v2: remove Metadata.Monospace
Apparently calculating to detection whether a face is monospace or not is pretty heavy as this might iterate all the glyphs.
This commit is contained in:
parent
8777d2c529
commit
2bad1b928f
@ -21,21 +21,19 @@ import (
|
|||||||
|
|
||||||
// Metadata represents a font face's metadata.
|
// Metadata represents a font face's metadata.
|
||||||
type Metadata struct {
|
type Metadata struct {
|
||||||
Family string
|
Family string
|
||||||
Style Style
|
Style Style
|
||||||
Weight Weight
|
Weight Weight
|
||||||
Stretch Stretch
|
Stretch Stretch
|
||||||
Monospace bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func metadataFromLoader(l *loader.Loader) Metadata {
|
func metadataFromLoader(l *loader.Loader) Metadata {
|
||||||
d := metadata.Metadata(l)
|
f, a, _ := metadata.Describe(l, nil)
|
||||||
return Metadata{
|
return Metadata{
|
||||||
Family: d.Family,
|
Family: f,
|
||||||
Style: Style(d.Aspect.Style),
|
Style: Style(a.Style),
|
||||||
Weight: Weight(d.Aspect.Weight),
|
Weight: Weight(a.Weight),
|
||||||
Stretch: Stretch(d.Aspect.Stretch),
|
Stretch: Stretch(a.Stretch),
|
||||||
Monospace: d.IsMonospace,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user