Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can an emoji be displayed?
#4
Code: (Select All)
Sub SafeLoadFont (font#)
'Safely loads a font without destroying our current print location and making it revert to the top left corner.

down = CsrLin: right = Pos(0)
down = (down - 1) * _FontHeight
If _FontWidth <> 0 Then 'weed start with a monospace font
right = (right - 1) * _PrintWidth(" ") 'convert the monospace LOC to a graphic X coordinate
End If
_Font font#
If _FontWidth <> 0 Then 'we swapped to a monospace font
right = (right / _PrintWidth(" ")) + 1 'convert the graphic X coordinate back to a monospace LOC column
End If
down = (down / _FontHeight) + 1
If right < 1 Then right = 1
Locate down, right
End Sub


Instead of using _FONT to swap to the new font, use _SafeLoadFont instead. It's been a standard part of my extended toolbox of routines which I make use of for years now. Smile
Reply


Messages In This Thread
How can an emoji be displayed? - by PhilOfPerth - 04-21-2024, 01:18 AM
RE: How can an emoji be displayed? - by SMcNeill - 04-21-2024, 06:34 AM
RE: How can an emoji be displayed? - by SMcNeill - 04-21-2024, 06:41 AM
RE: How can an emoji be displayed? - by grymmjack - 04-21-2024, 03:04 PM
RE: How can an emoji be displayed? - by a740g - 04-21-2024, 06:28 PM
RE: How can an emoji be displayed? - by bplus - 04-21-2024, 06:47 PM



Users browsing this thread: 1 Guest(s)