POV-Ray : Newsgroups : povray.advanced-users : Requesting a more comprehensive text {} usage tutorial - utf8, ALT-####, et= : Re: Requesting a more comprehensive text {} usage tutorial - utf8, ALT-####= Server Time
28 Mar 2024 09:12:27 EDT (-0400)
  Re: Requesting a more comprehensive text {} usage tutorial - utf8, ALT-####=  
From: Bald Eagle
Date: 6 Jul 2021 22:10:00
Message: <web.60e50c29d0fecd301f9dae3025979125@news.povray.org>
Did I ever mention that handling of character encoding in POV-Ray v3.7
is seriously borked?

.. . . maaaaaaaaayyyyyyyybe.

And the decision was made to retain this borkedness in v3.8, for the
sake of backward compatibility.

you - - - might have mentioned that at some point.

And you shouldn't be using v3.8.0-10008988 or later, as most of the
changes they have brought will _not_ make it into v3.8.0 proper.
Particularly not any changes regarding character encoding.

I use Dick Balaska's qtpovray, much to jr's consternation.  I have way too much
going on right now to go rearranging my "workflow".  Maybe this Fall.


Oh, and in case you're trying this with the "ANSI_GDT" font, version
1.0, from 1998: That one also seems to be borked, and is not helping.

No idea.
I tried with the 3 shipped fonts, and then moved on.

As for the character codes given on that web page:

- The Alt+X codes _should_ directly translate to `\uXXXX` codes.
Provided the borkedness of POV-Ray's TrueType handling doesn't get in
the way, and `charset` is set to `utf8` or `sys`.

They do not.  But I found a page that provides a mapping.

- Alt-codes starting with "0" _should_ directly translate to `chr(n)`.
Again provided the borkedness of POV-Ray's TrueType handling doesn't get
in the way.

Maybe yes, maybe no.  It gets weird.

- For other Alt-codes there is _some_ mapping, but it is far from
trivial, and is related to old DOS-era character codes. And again, it is
subject to borkedness and possibly `charset`.

Yes, I saw some notes to that effect.

- Some of those codes may only be valid for that particular font.

Right.
So just for anyone else looking to dabble with any of this, this is what I
found:

"We are the Bork.  You will be dissimilated, and your assstinktiveness will be
retained in the source code."

Aside from that, the "Character Map" (charmap) is a POS.  Confusing and not very
helpful.
I downloaded FontForge and that seems to work very nicely.

What that will tell you is that lots of fonts don't have very much content - and
there are tons of unicode entries "left blank".  FontForge will show you the map
entry, what ought to be there if a glyph has been constructed, and whether it
exists or not.   It will also give you information about any faults and errors
in the font file, such as incorrect mappings.

After researching a bit more and searching for a "more complete" unicode font, I
found:

lucida-sans-unicode.ttf is a fairly complete font for these purposes, but better
is:

arial-unicode-ms.ttf  Which has quite a lot of the goodies.

I would recommmend that anyone desiring to make use of symbols download these
fonts and put them in their include file path.
It not only has the symbols that I was looking for here, but all of the math
symbols, and plenty of arrow and other symbols that would be useful as a quick
way of drawing those without a macro and a bunch of 3D primitives.

https://allfont.net/download/lucida-sans-unicode/#download
https://ufonts.com/downloads/197925!474209627

So yes, the fundamental issue is that most fonts are crap, or at least woefully
sparse.
.... Unless P J O'Rork from York horked a cork with a fork and porked Mork from
Ork like a dork (or that Ferengi Quark) while playing Zork, thereby screwing up
the character map encoding . . . but absent that, the character mapping for the
\uNNNN codes seems to be fairly reliable and consistent across the handful of
fonts I sifted through.

Other than that, POV-Ray seems to have handled everything fairly nicely.  Some
of the glyphs are a wee bit spindly, but that's the font, not POV-Ray.  I just
deleted the whole charset and utf8, and so now there's no parse warning, and
everything works great anyway.

:D


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.