> When copying a string into a field, is there a quick and simple way to
determine whether the copied string can actually be displayed in the
current
field font? e.g. letters produce a hollow rectangle when displayed in the
LED
font. I would like to exclude those undisplayable characters that
shouldn't be
in the source string.

Unfortunately there's no API for querying a given font's set of defined glyphs. On pre-Palm OS 5 you could roll your own by inspecting the font data, though I don't think that would work any longer when you're running under PACE, and it wouldn't work for Japanese, Chinese, or other non-Latin locales that use complex fonts.


OTOH, the set of defined glyphs in the LED font hasn't changed much over time (maybe since 3.5?), so if that's the specific font that you need to deal with then that's a pretty simple check.

Or, if you really needed a general solution, you could craft your own by drawing both a known invalid character and the target character to off-screen bitmaps and comparing the bits. Ugly, I know.

-- Ken
--
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to