1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-26 19:38:22 +01:00
Diya-API/Diya/DiyaFontStyle.class.st
2022-03-06 00:58:28 +01:00

57 lines
898 B
Smalltalk

Class {
#name : #DiyaFontStyle,
#superclass : #DiyaBaseObject,
#instVars : [
'texmap',
'face',
'name'
],
#category : #'Diya-Fonts'
}
{ #category : #'instance creation' }
DiyaFontStyle class >> fromFace: aFace [
^self new face: aFace; yourself
]
{ #category : #accessing }
DiyaFontStyle >> face [
^ face
]
{ #category : #accessing }
DiyaFontStyle >> face: anObject [
face := anObject
]
{ #category : #initialization }
DiyaFontStyle >> initialize [
super initialize.
texmap := Dictionary new.
]
{ #category : #accessing }
DiyaFontStyle >> name [
^ name
]
{ #category : #accessing }
DiyaFontStyle >> name: anObject [
name := anObject
]
{ #category : #accessing }
DiyaFontStyle >> texmap [
^ texmap
]
{ #category : #initialization }
DiyaFontStyle >> textureOf: size [
|tex|
tex := texmap at: size ifAbsentPut: [
""
OpenGLFontTex fromFace: face ofSize: size
].
^tex
]