Checking if a glyph is available

Hi,
(it seems that inserting the Emoji lens, the conversation appears with an empty body.
So, below, I use lensGlypg instead of hardcoding the lens-glyph).

I would like to use the “lens” glyph of Emoj in an app of mine, as below:

Sub Paint(index as Integer, g As Graphics, areas() As REALbasic.Rect)
g.ForeColor = clrWhite
g.FillRect 0,0,me.Width,me.Height
g.TextFont = “System”
g.TextSize = 14
g.DrawString lensGlyph, 3,15
#Pragma unused areas
End Sub

Is there any chance that this glyph may not be available if the user uses as system font a font that does not include Emojis?
So, in order to avoid gibberish, is there a way to detect if the user’s system font does include Emojis?
Thanks.

you might want to tell us how you defined “lensGlyph”
you are showing how you USED it, but not what you defined it as. without that information nobody can help

and unless the emoji is ONLY available in a font that the user would have to install them selves, there should not be a problem

I’m not sure I understand what you wish to know. Anyway, in place of “lensGlyph” the code contains the lens glyph double-clicked in Edit > Emoji, surrounded by “”.
As I said, I cannot insert such glyph here, otherwise the conversation doesn’t go thru.

On OS X the system will substitute the missing character from another font.
So no need to check.

Thank you, Christian. It is good news for OS X.
Any idea on Windows?

[quote=260532:@Carlo Rubini]I’m not sure I understand what you wish to know. Anyway, in place of “lensGlyph” the code contains the lens glyph double-clicked in Edit > Emoji, surrounded by “”.
As I said, I cannot insert such glyph here, otherwise the conversation doesn’t go thru.[/quote]

What character are you referring to when you say “lensglyph”

g.DrawString lensGlyph, 3,15

somewhere you must have something like

lensGlyph=&u1234

or something similar

No, I have g.drawString “”,3,15
where the glyph is between the “” (as in “a”, 3,15).

a) that is NOT what you code snippet in the OP says…
b) I give up asking… WHAT IS THIS GLYPH? there are 10’s of thousands of glyphs, and nobody can help if you are unwilling or unable to provide the required information.

Is it an “eyeball”? a “pair of glasses”? a “magnify glass”? the more we have to guess, the less likely for you to get an answer

How did you get the glyph between the quotes? Copy/Paste? if so, from where? Type it with special keystrokes? if so, what were they?

in my OP I wrote:

[quote](it seems that inserting the Emoji lens, the conversation appears with an empty body.
So, below, I use lensGlypg instead of hardcoding the lens-glyph).[/quote]

The glyph I’m referring to, is the “Emoji lens” that appears in the list of Emojis: U + 1F50D.

The glyph itself cannot be pasted here otherwise the body of this post will become empty. It is not that I’m unwilling or unable to provide it.

  const lensGlyph=&u1f50d
  g.ForeColor = &cffffff
  g.FillRect 0,0,me.Width,me.Height
  g.TextFont = "System"
  g.TextSize = 14
  g.DrawString lensGlyph, 3,15

Fine. The question, partially answered by Christian, was: what happens if a user has got a system font that does not support &u1f50d? Is there a way to check in advance if &u1f50d is available?
Thanks.

WOW… you are really appreciative of getting an answer aren’t you?

[quote=260534:@Christian Schmitz]On OS X the system will substitute the missing character from another font.
So no need to check.[/quote]

Like he said… THERE IS NO NEED TO CHECK… the OS will find the right font, and unless the user has deleted most of the installed fonts that come with OSX or WIN, there will not be an issue. This means the user has to have screwed up their own system for this not to work.

Thank you for supplying also the answer related to WIN.

You mean this one?
:mag:

Left pointing magnifying glass

Windows does glyph substitution as well. But when it comes to Emoji, you may get a black and white smilie face on systems older than Windows 10.

If the user has messed up his system by removing all fonts that support &u1F50D, he will get a splendid rectangle instead of a left magnifying lens. C’est la vie.

@Derk Jochems Yes.

@Michel Bujardet For OS X I had made some test setting primary language to Chinese, Hindi etc. and &u1F50D showed up all right; besides, I don’t think it is so easy or common to change the system font. For Windows I have much less experience, so I appreciate your comment.