QB64 Phoenix Edition
Font Cut Off - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10)
+---- Thread: Font Cut Off (/showthread.php?tid=1545)



Font Cut Off - NasaCow - 03-13-2023

So, during my rewrite I am condensing the number of files needed by having all (or most) of my menus printed. I tried my orignal font I was using and saw it was cutting off the top and bottoms of some letters. I also tried some cursive fonts (only one seemed to work but it also cut the top and bottoms of some letters) and seems that compiler doesn't like that and puts space between words. Or maybe I am doing something wrong as well. Just want to see what y'all think about it.


[Image: image.png]

You can see that capital J and Y are cut and lower f, j, q, and y are also cut.

Code: (Select All)
$NOPREFIX

SCREEN NEWIMAGE(1280, 720, 32)

FONT LOADFONT("script.ttf", 72)

PRINT "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
PRINT
PRINT "abcdefghijklmnopqrstuvwxyz"
 Nothing fancy done to the code. I will include the font as well if you want to try it out. I have been trying fonts from Google: https://fonts.google.com so I assume the fonts are ok...


RE: Font Cut Off - bplus - 03-13-2023

Yes not all fonts work well in QB64, mostly I find the letters chopped off at top. Some will work though.

Maybe we should setup a resource board to share fonts that have un-restricted license for sharing.


RE: Font Cut Off - SMcNeill - 03-13-2023

https://staging.qb64phoenix.com/showthread.php?tid=313 -- Try it with QPrint.  Wink


RE: Font Cut Off - NasaCow - 03-13-2023

(03-13-2023, 04:33 AM)SMcNeill Wrote: https://staging.qb64phoenix.com/showthread.php?tid=313 -- Try it with QPrint.  Wink

I ran the program, and it brought something else up that I asked a long time ago. I saw it print Japanese! Could qprint also work to print Chinese characters? This would be a huge boon for me as well.

I am playing with it as I type  Big Grin  Assuming I just need to include falcon.h for qprint or do I need to use the example code to make, for example, "qprint.bas" and include that?

Thanks, looks like great stuff!


RE: Font Cut Off - SMcNeill - 03-13-2023

(03-13-2023, 06:43 AM)NasaCow Wrote:
(03-13-2023, 04:33 AM)SMcNeill Wrote: https://staging.qb64phoenix.com/showthread.php?tid=313 -- Try it with QPrint.  Wink

I ran the program, and it brought something else up that I asked a long time ago. I saw it print Japanese! Could qprint also work to print Chinese characters? This would be a huge boon for me as well.

I am playing with it as I type  Big Grin  Assuming I just need to include falcon.h for qprint or do I need to use the example code to make, for example, "qprint.bas" and include that?

Thanks, looks like great stuff!

It does unicode, so as long as your font contains those characters, it'll print them.  If you want to turn the example code into a library, what you'd need for you *.BM file would be the $IF section at the top of the code to declare the c code which we're linking to and using, and then all the subs/functions after the END statement.  After that, just tack a Q onto the front of most of the common QB64 print commands that you're used to and use them instead of our standard commands.  (QPrint, QPrintWidth, QFontHeight, QPrintString)  The library is meant to be a simple header/replacement for our basic print commands to fix the clipping and offer expanded unicode support.  It honestly shouldn't be hard to sort out, but if you have any questions or problems, feel free to post them and I'll answer as best as possible.  Smile

*falcon.h needs to go into your qb64 root directory, from I remember.  I don't think it'll find itself or work properly from a subfolder.


RE: Font Cut Off - NasaCow - 03-14-2023

Now I can use the font I was orignally wanting to use. Qprint is amazing!

[Image: image.png]

I like using OPTION EXPLICIT (with $NOPREFIX of course  Cool)

So I had to make some DIMs in the *.BM to make it work with explicit. I'll upload the files here as well. I had to also copy some of the other files from internal/c/.... since I was compiling from the source folder (my project folder and had to strip out the path name) so it may be helpfult to have those headers too! I'll include a zip file of the changes I made.

It is very easy to use tool and just took throwing a q in front of the commands. Some of the simplest tools 10/10 for ease fo use and results! Thank you Steve!


RE: Font Cut Off - SMcNeill - 03-14-2023

Happy to be of help and I'm glad to see someone making use of it.  Smile


RE: Font Cut Off - RhoSigma - 03-14-2023

If you need more options, maybe automatic underlining or boxing, and want to be able to use all _PRINTMODEs, you can also have a look on UPrint.

It's actually the base work which Steve derived and borrowed for his simplyfied QPrint (with permission of course, even if it's all public domain).