Advertisement
Guest User

Untitled

a guest
Aug 9th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.93 KB | None | 0 0
  1. types.nim:
  2.  var n22*: Engine22Manager
  3.  
  4.  proc en*(): var Engine22Manager {.inline.} = n22  # accessor for engine singleton - artifact from an earlier time when I
  5.                                                    # barely knew Nim/was trying to get hot patching dlls working, (pre arc)
  6. --------------------------
  7. fontManager.nim: [Version throwing unhandled exception: index 1 not in 0 .. 0 [IndexDefect]]
  8.  proc getFont*(fontName: string, size: int, fontMgr: FontManager): E22Font {.inline} =
  9.   let indexName = fontName & "_" & $size
  10.   if en().fm.fontIndices.hasKey(indexName):
  11.     return en().fm.fonts[en().fm.fontIndices[indexName]]
  12.   else: ...
  13.  
  14. --------------------------
  15. fontManager.nim: [Version now working]
  16.  proc getFont*(fontName: string, size: int): E22Font {.inline} =
  17.   let indexName = fontName & "_" & $size
  18.   if n22.fm.fontIndices.hasKey(indexName):
  19.     return n22.fm.fonts[n22.fm.fontIndices[indexName]]
  20.   else: ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement