Skip to content

Commit

Permalink
Fix the font cache, use the right font in the editor. ALL GOOD FOR PR…
Browse files Browse the repository at this point in the history
…IME TIME
  • Loading branch information
Amos Wenger committed Dec 21, 2011
1 parent 5dad457 commit 99d935c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/game/Editor.ooc
Expand Up @@ -78,7 +78,8 @@ Editor: class extends Actor {
paint: func (cr: Context) {
if (ui mode != UIMode EDITOR) return

cr selectFontFace("Impact", CairoFontSlant NORMAL, CairoFontWeight NORMAL)
// that's ugly
cr setFontFace(LabelSprite cache get("assets/fonts/impact.ttf"))
cr setSourceRGB(1.0, 0.3, 0.3)
cr moveTo(100, 100)
cr setFontSize(40.0)
Expand Down
1 change: 1 addition & 0 deletions source/ui/Sprite.ooc
Expand Up @@ -222,6 +222,7 @@ LabelSprite: class extends Sprite {
logger warn("Loading font failed, falling back on default font")
} else {
font = newFontFromFreetype(ftFace, 0)
cache put(path, font)
}
}

Expand Down

0 comments on commit 99d935c

Please sign in to comment.