Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - xband

Pages: [1]
1
QB64 Discussion / Re: Font Clipping
« on: July 15, 2019, 02:18:09 pm »
ah ok, fortunately i was able to find a different font with a similar style that didn't clip. thanks.

2
QB64 Discussion / Font Clipping
« on: July 15, 2019, 02:02:33 pm »
Some fonts are getting cut off at the top using _PRINTSTRING. It happens with consolas and a handful of other fonts.

Is this a bug?

Code: QB64: [Select]
  1. DIM mscreen AS INTEGER
  2. DIM rootpath AS STRING
  3. DIM fontfile AS STRING
  4. DIM fonthandle AS INTEGER
  5.  
  6. DIM xoffset AS INTEGER
  7. DIM yoffset AS INTEGER
  8.  
  9. DIM CH(1 TO 72) AS STRING
  10. FOR i = 1 TO 63
  11.     CH(i) = CHR$(33 + i)
  12. CH(64) = "{"
  13. CH(65) = "|"
  14. CH(66) = "}"
  15. CH(67) = "~"
  16. CH(68) = CHR$(30)
  17. CH(69) = CHR$(31)
  18. CH(70) = CHR$(16)
  19. CH(71) = CHR$(17)
  20. CH(72) = CHR$(1)
  21.  
  22.  
  23. rootpath = ENVIRON$("SYSTEMROOT")
  24. fontfile = "consola.ttf"
  25. fonthandle = _LOADFONT(fontfile, 60, "MONOSPACE")
  26.  
  27. mscreen = _NEWIMAGE(1024, 1024, 32)
  28. SCREEN mscreen
  29.  
  30. _FONT fonthandle, mscreen
  31. xoffset = 0
  32. yoffset = 0
  33.  
  34. '_CLEARCOLOR _RGB(0, 0, 0), mscreen
  35.  
  36.     CLS , _RGB(30, 30, 30)
  37.     '===============
  38.     xoffset = 0
  39.     yoffset = 0
  40.     FOR i = 1 TO 72
  41.         _PRINTSTRING (xoffset, yoffset), CH(i)
  42.         xoffset = xoffset + 64
  43.         IF xoffset > 960 THEN
  44.             xoffset = 0
  45.             yoffset = yoffset + 64
  46.         END IF
  47.     NEXT
  48.     '===============
  49.     _LIMIT 60
  50.     _DISPLAY
  51.  
  52.  
  53.  

Pages: [1]