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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fibonacci Help needed! Unseen Machine 18 1,399 12-26-2025, 09:05 PM
Last Post: Petr
  Font Size in Threads Dimster 5 372 12-12-2025, 04:49 PM
Last Post: Dimster
  Problem with font in Teletext browser. SquirrelMonkey 7 756 08-27-2025, 11:38 AM
Last Post: BDS107
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 972 08-03-2025, 02:55 AM
Last Post: SMcNeill
  need help printing a scaled string in a custom font to a 32-bit image madscijr 9 1,159 07-03-2025, 04:48 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)