Skip to content

Instantly share code, notes, and snippets.

@guillep
Created April 5, 2019 15:15
Show Gist options
  • Save guillep/d9929c0d684264ccecefe361d58e9509 to your computer and use it in GitHub Desktop.
Save guillep/d9929c0d684264ccecefe361d58e9509 to your computer and use it in GitHub Desktop.
styler := SHRBTextStyler new.
text := 'EEEE' asText.
styler classOrMetaClass: Object.
styler styledTextFor: text.
text asOrderedCollection collect: [ :each |
FreeTypeGlyphRenderer current
subGlyphOf: each
colorValue: 0
mono: false
subpixelPosition: 0
font: (StandardFonts codeFont instVarNamed: #boldDerivative) realFont
].
(StandardFonts codeFont instVarNamed: #boldDerivative) realFont
linearKerningLeft: $m right: $e.
(StandardFonts codeFont instVarNamed: #boldDerivative) realFont
linearKerningLeft: $e right: $s.
StandardFonts codeFont realFont widthOf: $e.
FreeTypeCache current
atFont: StandardFonts codeFont realFont
charCode: $e asInteger
type: 200.
"ifAbsent: []."
r := RubEditingArea new.
r
setTextWith: text;
textFont: StandardFonts codeFont;
openInWindow.
r := RubEditingArea new.
r
setTextWith: text;
textFont: StandardFonts codeFont;
drawSubmorphsOn: (FormCanvas extent: 200@200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment