mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
text/v2: refactoring
This commit is contained in:
parent
f34f93a117
commit
415b9c382f
@ -104,13 +104,13 @@ func NewGoTextFaceSource(source io.ReadSeeker) (*GoTextFaceSource, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ft, err := ofont.NewFont(l)
|
f, err := ofont.NewFont(l)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &GoTextFaceSource{
|
s := &GoTextFaceSource{
|
||||||
f: &ofont.Face{Font: ft},
|
f: &ofont.Face{Font: f},
|
||||||
}
|
}
|
||||||
s.addr = s
|
s.addr = s
|
||||||
s.metadata = metadataFromLoader(l)
|
s.metadata = metadataFromLoader(l)
|
||||||
@ -132,12 +132,12 @@ func NewGoTextFaceSourcesFromCollection(source io.ReadSeeker) ([]*GoTextFaceSour
|
|||||||
|
|
||||||
sources := make([]*GoTextFaceSource, len(ls))
|
sources := make([]*GoTextFaceSource, len(ls))
|
||||||
for i, l := range ls {
|
for i, l := range ls {
|
||||||
ft, err := ofont.NewFont(l)
|
f, err := ofont.NewFont(l)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
s := &GoTextFaceSource{
|
s := &GoTextFaceSource{
|
||||||
f: &ofont.Face{Font: ft},
|
f: &ofont.Face{Font: f},
|
||||||
}
|
}
|
||||||
s.addr = s
|
s.addr = s
|
||||||
s.metadata = metadataFromLoader(l)
|
s.metadata = metadataFromLoader(l)
|
||||||
|
Loading…
Reference in New Issue
Block a user