Author Topic: Basics of QB64 - Using fonts  (Read 3399 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

FellippeHeitor

  • Guest
Basics of QB64 - Using fonts
« on: August 16, 2020, 10:45:41 pm »


This video will show you how you can use TTF, TTC and OTF font files in your QB64 programs.

Relevant wiki links:
http://www.qb64.org/wiki/LOADFONT
http://www.qb64.org/wiki/FONT
http://www.qb64.org/wiki/FREEFONT

Forum link with instructions to use Luke's alternative rendering functions directly (falcon.h):
https://www.qb64.org/forum/index.php?topic=1574.msg107948#msg107948

RhoSigma's wrapper library for falcon.h:
https://www.qb64.org/forum/index.php?topic=2248

THE OLDSCHOOL PC FONT RESOURCE:
https://int10h.org/oldschool-pc-fonts/fontlist/
« Last Edit: August 17, 2020, 07:49:15 am by FellippeHeitor »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Basics of QB64 - Using fonts
« Reply #1 on: August 17, 2020, 02:49:01 am »
Cool... Even "I" could follow and understand this tutorial. According to Einstein, you must really understand what you are teaching... "If you cannot explain it to a six year old then you don't understand it yourself."... Well done!
Logic is the beginning of wisdom.

Offline euklides

  • Forum Regular
  • Posts: 128
    • View Profile
Re: Basics of QB64 - Using fonts
« Reply #2 on: August 17, 2020, 04:13:49 am »
Thank you !
Why not yes ?

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Basics of QB64 - Using fonts
« Reply #3 on: August 17, 2020, 05:09:58 am »
If you are not familiar with calling C/C++ functions directly, then you might like to use the small UPrint toolbox library, which I've wrapped around the falcon.h functions.

It covers almost everything you can do with the C/C++ functions within a handfull easy to use BASIC functions and does also have various functions to convert strings into the UTF-8 format required by the falcon.h functions. It also brings back the ability to use the different PRINTMODEs with falcon.h, some examples complete the toolbox.

see here: https://www.qb64.org/forum/index.php?topic=2248
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

FellippeHeitor

  • Guest
Re: Basics of QB64 - Using fonts
« Reply #4 on: August 17, 2020, 07:47:49 am »
Thank you, @johnno56 and @euklides!

@RhoSigma thanks for reminding me of your wrapper! I'll point to it as well.
« Last Edit: August 17, 2020, 07:48:56 am by FellippeHeitor »

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Basics of QB64 - Using fonts
« Reply #5 on: August 17, 2020, 10:33:08 am »
Thanks Fellippe - you read all you want on a subject but there's nothing like a demostration of the application. One question on fonts on the text screen, can they only be monospaced? or is there an option for proportional spacing?

FellippeHeitor

  • Guest
Re: Basics of QB64 - Using fonts
« Reply #6 on: August 17, 2020, 11:30:46 am »
For screen 0/text mode you can only use fonts loaded with the "monospace" parameter.

Marked as best answer by on July 04, 2024, 04:05:41 am

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Basics of QB64 - Using fonts
« Reply #7 on: August 17, 2020, 07:12:35 pm »
  • Undo Best Answer
  • Dimster is correct. I haven't tried to work much with fonts. A few little things have been successful, but many others have not. It's nice to see a demonstration. Something that I can build upon. These are the best thing since Steve's _MEM tutorials. Thank you, sir.

    Offline hmjswt

    • Newbie
    • Posts: 7
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #8 on: August 18, 2020, 06:33:47 am »
    Hallo,

    Thank you, just what I was looking for.

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #9 on: August 18, 2020, 09:41:23 am »
    Cool!
    Good Job
    Programming isn't difficult, only it's  consuming time and coffee

    Offline JohnUKresults

    • Newbie
    • Posts: 40
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #10 on: August 24, 2020, 08:00:06 am »
    Thanks for this tutorial - much appreciated.

    I was struggling with a very small window size on my Win10 pcs, while running my dos program in text mode.

    This should help my eyesight!!

    Offline wiggins

    • Newbie
    • Posts: 34
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #11 on: August 25, 2020, 07:35:05 pm »
    Thank you for this excellent video.  Your example programs so so easy to follow.

    Offline JohnUKresults

    • Newbie
    • Posts: 40
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #12 on: August 25, 2020, 08:00:59 pm »
    Is there a rule of thumb to follow when trying to find a font which looks OK when scaled up?

    I have had a look at the fonts website suggested by Fellippe and some of the 8x8 fonts actually make the window look smaller than the default on my windows pc, while some of the other fonts look very scrappy when enlarged.

    I assume you should try to use multiples of the pixel height to scale them up, but would other scales also work. For example,  if you have an 8 pixel high font, should you stick to 8, 16, 24 etc. Or would 12 and 20 also work?

    Also had a look at the built in Windows fonts but not spotted anything which looks OK in dos yet! So you know, I only work in 5ext mode, not graphic.

    I know you will just say experiment 😏 🙂!!

    FellippeHeitor

    • Guest
    Re: Basics of QB64 - Using fonts
    « Reply #13 on: August 25, 2020, 08:18:10 pm »
    Yeah, experimenting is the best way... And when it's fixed size, I usually go for multiples of the original size, as you mentioned.

    Offline JohnUKresults

    • Newbie
    • Posts: 40
      • View Profile
    Re: Basics of QB64 - Using fonts
    « Reply #14 on: August 26, 2020, 11:54:44 am »
    ok thanks Fellippe.