File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Sources/GateEngine/Resources/Text/Backends Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 66 */
77
88struct ImageFont : FontBackend {
9- private let fontData :
10- [ Font . Style : ( rawTexture: RawTexture , importer: any TextureImporter . Type ) ]
9+ private let fontData : [ Font . Style : ( rawTexture: RawTexture , importer: any TextureImporter . Type ) ]
1110 internal var nativePointSizes : [ Font . Style : UInt ] = [ : ]
1211 internal var textures : [ Font . Style : Texture ] = [ : ]
1312 internal var characterXAdvances : [ Font . Style : [ Float ] ] = [ : ]
@@ -67,6 +66,11 @@ struct ImageFont: FontBackend {
6766 origin: GameMath . Position2 ,
6867 xAdvance: inout Float
6968 ) -> AlignedCharacter {
69+ if nativePointSizes [ key. style] == nil {
70+ // We need to know the native font point size, and we need to load it's texture to know
71+ // So populate the style if needed
72+ _ = populate ( style: key. style)
73+ }
7074 let nativePointSize = nativePointSizes [ key. style] !
7175 let scaledPointSize = Float ( key. pointSize - ( key. pointSize % nativePointSize) )
7276
You can’t perform that action at this time.
0 commit comments