Author Topic: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5  (Read 5572 times)

0 Members and 1 Guest are viewing this topic.

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Cannot Get FONTS to work in v1.5
« Reply #15 on: March 20, 2021, 04:51:22 pm »
Fillippe, yes, it was originally Veranda.ttf and that was the name I was using in my code.

Then I renamed it to veranda.ttf (all lowercase) and no changes to my results.

I just posted code that seems to now load it, but the PRINT does not reflect the size of the font.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

FellippeHeitor

  • Guest
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #16 on: March 20, 2021, 04:52:23 pm »
Take time to check my replies above.

Marked as best answer by George McGinn on March 20, 2021, 12:57:47 pm

FellippeHeitor

  • Guest
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #17 on: March 20, 2021, 04:53:41 pm »
Making it clearer:

Code: QB64: [Select]
  1. '--------------------------------
  2. '*** Initialize SCREEN
  3. 'SCREEN 12
  4. SCREEN _NEWIMAGE(1024, 700, 32)
  5.  
  6. '*** Setup Font Type and Size
  7.  
  8. f28& = _LOADFONT("verdana.ttf", 28, "MONOSPACE")
  9. PRINT f28&
  10. IF f28& > 0 THEN _FONT f28&  'This is where you apply the font
  11. PRINT "Hello World"
  12.  
  13. f64& = _LOADFONT("verdana.ttf", 64, "MONOSPACE")
  14. PRINT f64&
  15. IF f64& > 0 THEN _FONT f64&  'This is where you apply the font
  16.  PRINT "Hello World"
  17.  
« Last Edit: March 20, 2021, 04:56:15 pm by FellippeHeitor »

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Cannot Get FONTS to work in v1.5
« Reply #18 on: March 20, 2021, 04:54:45 pm »
Spelling was not the issue, as I copied the name directly from the file into my program after my first attempt failed. I even used the Veranda Bold.ttf and it also did not work.

Any spelling mistakes was due to fat-fingering the keyboard and I made sure that all spelling was corrected before posting this.

I even make it all lowercase as you suggested in the Discord talk.

Ok, so we've probably solved the problem.

1- George had the wrong spelling all along.
2- Fonts are working fine in v1.5 - across platforms.
3- @George McGinn after you use _LoadFont, you have to check that the resulting handle (f& for you) is greater than 0. After you check that, you have to actually apply the font using the _FONT statement. http://www.qb64.org/wiki/FONT
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #19 on: March 20, 2021, 04:56:23 pm »
The code below does not show differences in font sizes. Why?

Code: QB64: [Select]
  1. '--------------------------------
  2. '*** Initialize SCREEN
  3. 'SCREEN 12
  4. SCREEN _NEWIMAGE(1024, 700, 32)
  5.  
  6. '*** Setup Font Type and Size
  7.  
  8. f& = _LOADFONT("verdana.ttf", 28, "MONOSPACE")
  9.  
  10. PRINT "Hello World"
  11.  
  12. f& = _LOADFONT("verdana.ttf", 64, "MONOSPACE")
  13.  PRINT "Hello World"
  14.  
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #20 on: March 20, 2021, 04:56:45 pm »
For font sizes the verdana.ttf you, @George McGinn, gave us to test allows larger sizes of 24, 36, 48, see my screen shot of verdana.ttf you gave us to sample.

Update: Maybe being ttf you can do all sizes in between, if you spell the name right ;-))
« Last Edit: March 20, 2021, 04:59:09 pm by bplus »

FellippeHeitor

  • Guest
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #21 on: March 20, 2021, 04:57:07 pm »
Take time to read all my replies above, @George McGinn - you're just replying blindly at this point.

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: [SOLVED/CLARIFIED] Cannot Get FONTS to work in v1.5
« Reply #22 on: March 20, 2021, 04:59:49 pm »
You are right. I did not see your other posts.

I just read them and tested the code you provided and it works on Linux.

Sorry, just things were happening too fast! When you turn 62, things will slow down :-)

Thanks. I just flagged your response as "Best Answer" and consider this closed.

George.

Take time to read all my replies above, @George McGinn - you're just replying blindly at this point.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)