Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Github QB64PE Toolbox
#15
(12-07-2023, 04:40 PM)SMcNeill Wrote: Now added the ability to embed a small selection of fonts directly into a QB64PE program, which means they wouldn't have to rely on any external files once compiled and ran, so you don't have to worry about the end user not having the proper files on their drive to run your program glitch-free.

Basic style example is below:
Code: (Select All)
$Let INCLUDE_ALL = TRUE
$Let EMBED_COURIER_NEW = TRUE
$Let EMBED_CONSOLA = TRUE
$Let EMBED_SOURCE_CODE_PRO = TRUE

'Note that we ALSO have to specify which fonts we want to embed in our program,
'as we do above with the EMBED_COURIER_NEW = TRUE statement.
'This is because fonts can become quite large in size, and no single program
'needs to become bloated by several hundred MB as it attempts to embed fonts in itself
'that it doesn't even make use of!


'$INCLUDE:'..\Library Files\Toolbox.BI'

Screen _NewImage(800, 600, 32)

f = ReturnFont("Courier New", 20, "") ' A simple little _LOADFONT replacement
_Font f: _PrintString (0, 0), "Hello World" ' except here, we specify the font's name (not FILE NAME)
_Font 16: _FreeFont f

f = ReturnFont("Courier New", 20, "Bold") ' and we can set the style which we want for the font.
_Font f: _PrintString (0, _FontHeight), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Courier New", 20, "Italic")
_Font f: _PrintString (0, _FontHeight * 2), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Courier New", 20, "Bold,Italic")
_Font f: _PrintString (0, _FontHeight * 3), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Consola", 20, "")
_Font f: _PrintString (0, _FontHeight * 5), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Consola", 20, "Bold")
_Font f: _PrintString (0, _FontHeight * 6), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Consola", 20, "Italic")
_Font f: _PrintString (0, _FontHeight * 7), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Consola", 20, "Bold,Italic")
_Font f: _PrintString (0, _FontHeight * 8), "Hello World"
_Font 16: _FreeFont f

f = ReturnFont("Source Code Pro", 20, "Medium")
_Font f: _PrintString (0, _FontHeight * 10), "Hello World"
_Font 16: _FreeFont f



'$INCLUDE:'..\Library Files\Toolbox.BM'

That is a cool idea. I love the ideas you have for embeding and including like this.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply


Messages In This Thread
Github QB64PE Toolbox - by SMcNeill - 10-13-2023, 01:45 AM
RE: Github QB64PE Toolbox - by PhilOfPerth - 10-13-2023, 03:48 AM
RE: Github QB64PE Toolbox - by SMcNeill - 10-13-2023, 08:10 PM
RE: Github QB64PE Toolbox - by grymmjack - 10-13-2023, 11:27 PM
RE: Github QB64PE Toolbox - by SMcNeill - 10-16-2023, 06:02 AM
RE: Github QB64PE Toolbox - by SMcNeill - 10-17-2023, 02:52 PM
RE: Github QB64PE Toolbox - by TempodiBasic - 10-25-2023, 01:17 AM
RE: Github QB64PE Toolbox - by SMcNeill - 12-07-2023, 03:13 AM
RE: Github QB64PE Toolbox - by mnrvovrfc - 12-07-2023, 02:07 PM
RE: Github QB64PE Toolbox - by SMcNeill - 12-07-2023, 04:40 PM
RE: Github QB64PE Toolbox - by grymmjack - 12-08-2023, 12:13 AM
RE: Github QB64PE Toolbox - by bplus - 12-07-2023, 05:16 PM
RE: Github QB64PE Toolbox - by SMcNeill - 12-07-2023, 05:32 PM
RE: Github QB64PE Toolbox - by SMcNeill - 12-07-2023, 06:37 PM
RE: Github QB64PE Toolbox - by grymmjack - 12-08-2023, 12:11 AM
RE: Github QB64PE Toolbox - by bplus - 12-08-2023, 12:14 AM
RE: Github QB64PE Toolbox - by SMcNeill - 12-08-2023, 12:24 AM
RE: Github QB64PE Toolbox - by a740g - 12-08-2023, 02:28 AM
RE: Github QB64PE Toolbox - by SMcNeill - 12-08-2023, 02:35 AM
RE: Github QB64PE Toolbox - by SMcNeill - 12-08-2023, 10:51 AM
RE: Github QB64PE Toolbox - by SMcNeill - 12-10-2023, 09:26 PM
RE: Github QB64PE Toolbox - by SpriggsySpriggs - 12-11-2023, 08:22 PM
RE: Github QB64PE Toolbox - by SMcNeill - 12-11-2023, 08:33 PM
RE: Github QB64PE Toolbox - by SpriggsySpriggs - 12-11-2023, 08:35 PM
RE: Github QB64PE Toolbox - by SMcNeill - 01-02-2024, 06:54 PM
RE: Github QB64PE Toolbox - by SpriggsySpriggs - 01-03-2024, 12:26 PM
RE: Github QB64PE Toolbox - by RhoSigma - 01-03-2024, 12:41 PM
RE: Github QB64PE Toolbox - by SpriggsySpriggs - 01-03-2024, 01:23 PM
RE: Github QB64PE Toolbox - by TempodiBasic - 08-11-2024, 11:00 AM
RE: Github QB64PE Toolbox - by RhoSigma - 08-11-2024, 11:11 AM



Users browsing this thread: 6 Guest(s)