Re: How do I know if a character can be displayed at all on the current screen?

From: Cameron Laird (claird_at_lairds.us)
Date: 09/13/04


Date: Mon, 13 Sep 2004 16:08:10 GMT

In article <ci433c$of0$3@wagner.wagner.home>,
Victor Wagner <vitus@45.free.net> wrote:
>Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> wrote:
>: Hi Eric,
>: Eric Brunel <eric_brunel@despammed.com> writes:
>: > If I run it on Linux or Windows with a Japanese font package
>: > installed, the Japanese character is correctly displayed; on Windows
>: > with no Japanese font package installed, it is displayed as a black
>: > rectangle.
>: >
>: > The question is: how can I know whether I'm in the first or the
>: > second case? I looked the man page for the font command in 8.3, 8.4
>: > and 8.5, but nothing seems available. Searching the newsgroup
>: > archive only returned unanswered questions... Ideas anyone?
>: You can't do that in Tk currently. Tk simply requires that the
>: necessary fonts are installed on the system.
>: If the current font doesn't have a character, Tk will search all
>: installed fonts for a match, so you usually do not need to know if
>: current font specifically has a specific character. This
>: font-fallback is an internal mechanism though, and implemented using
>: system-specific means. It doesn't export any script-visible
>: interfaces.
>
>Problem is that this fallback mechanism typically picks ugliest font on
>my system.
>
>For instance, for all standard font families I have collection of fonts
>with identical glyphs for all possible cyrillic encodings. But if I
>specify something like Helvetica it picks up something with very
>different glyphs for Cyrillic and ASCII.
>
>If I specify XLFD name for font which I know contains all neccessary
>glyphs, I see the same problem, regardless of font encoding I specify in
>XLFD (I can choose koi8-r, microsoft-cp1251, iso8859-5 and iso10646-1 -
>all fonts are present and compiled from same bdf file).
>
>Only reliable way I found to get nice looking text in tk yet - use
>Microsoft TTF fonts exclusively. But using true type is not always
>desirable. Hand-tuned bitmapped fonts looks much better in small sizes.
>--

Font programming frustrates me, and I'm reasonably confident
that Tk can't solve all the problems on its own. I strongly
suspect, though, that, if we applied ourselves to it for a
few hours of intense co-operation, we could come up with a
TIP to extend 145 and 213 to provide more introspection.
Some means to compute, "given this character in this context,
Tk will render based on this glyph", would, I think, solve a
lot of the most pressing problems.

Also, Richard Suchenwirth probably has clever ways to make
things come out nicely with the existing Tk, but I'm not yet
font-savvy enough to understand them.



Relevant Pages

  • Re: Unicode APL Programming Font with Serifs
    ... beyond APL if that's possible. ... glyphs on input mapping to just one on output. ... Sixpack is a wedge serif, variable width font, which includes sufficient characters for modern European usage, plus a number of mathematical symbols ... I am now inclining rather to the view that this is an impossible goal -- if you're not going to use fixed character widths, and emulate a 25 x 80 screen, you're going to have to learn to do the job properly ...
    (comp.lang.apl)
  • Re: Uses for Screen OCR Technology ???
    ... It works with any machine generated character glyphs that have visible pixels ... I don't know what your {"all characters are invisible" font} ...
    (comp.lang.java.programmer)
  • Unicode support in Thunderbird
    ... specify a Unicode font in Thunderbird? ... set for a number of different languages, ... they specify a character set. ... there is no way to configure a font for the "language" ...
    (comp.os.os2.misc)
  • Re: Different behaviour of NimbusMonL-Bold and Courier-Bold in PDF created by pdfwrite
    ... This set of tests uses character codes 0 to 255 to draw the glyphs. ... Providing the fonts *used to create the PDF file* are encoded the same, ... "unencoded characters") do show considerable differences. ... The result is that the font dictionaries in the two PDF files will ...
    (comp.lang.postscript)
  • Re: Different behaviour of NimbusMonL-Bold and Courier-Bold in PDF created by pdfwrite
    ... glyphs in this case, but not in the same order. ... doesn't actually embed these as text in the PDF document at all. ... I'm still struggling with the "obviously its the same font that was ... Courier-Bold ...
    (comp.lang.postscript)