Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading font from memory help needed...
#3
Sure.  Here's an example fontdata$ that doesn't work.  I will attach the font file I'm grabbing the fontdata$ from.

I will eventually load fontdata$ directly from .BAS code instead of an external file like below, but doing this way right now just to test different fonts.  My font data doesn't load from string "memory" this way for some reason.


EDIT: I can't seem to attach the font file - forum won't let me.  Can you subsitute with a font on your end to see if the loading a font this way works for you?  Here's a link to the same font file.

- Dav

Code: (Select All)

'load from file into fontdata$
Open "monofonto.otf" For Binary As 1
fontdata$ = Input$(LOF(1), 1)
close

'load from fontdata$ string memory
myfont& = _LoadFont(fontdata$, 32, "memory")
_Font myfont&

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
Loading font from memory help needed... - by Dav - 09-16-2023, 12:10 AM
RE: Loading font from memory help needed... - by Dav - 09-16-2023, 12:43 AM



Users browsing this thread: 1 Guest(s)