[B-Greek] UTF
William Zeitler
william at faithfulbible.com
Fri Jan 7 16:13:48 EST 2005
You're right, this has gotten entirely too technical, and I didn't help
matters.
This IS a little off topic, but rendering Greek in web browsers is of
interest to many of us.
I was a programmer at Microsoft for several years, and wrote routines to
render multi-byte and unicode byte streams. Admittedly that was 1997-1999,
so I've forgotten some of the fine points of the jargon.
But the basic process is the same, and helpful for sorting out the potential
headaches.
It's basically a HIEROS GAMOS. You parse/read a chunk of the byte stream,
'marry it' to the font that is currently selected, and render it (draw the
glyphs on the display or printed page). There's nothing intrinsic about a
byte stream that tells you that it's UTF-8 or whatever. Some file formats
include that information (like a Word document), others don't (like generic
.txt files).
(It's entirely possible to have the wrong font selected, for a long list of
reasons, or to assume you're reading a UTF-8 byte stream when it's really
Unicode, ferinstance, and the byte stream will still be perfectly 'legal'
but the text that is rendered will be pure gibberish to us humans.)
In the case of a standalone machine -- using MS Word, for example, you have
to have the font installed to create the document with it in the first
place. This sounds a little silly, but the point is that if you have the
font installed at all, it's also available for printing, your browser, etc.
The case of viewing text over a network (including the internet) is another
matter entirely, and that's what I understood the crux of the question to
be. Unlike the Microsoft Word on a standalone machine example, where both
byte stream and font are on the same machine, when you have a browser
connected to a server you have the byte stream on the server, but it's being
rendered on a different machine (namely the client/student's machine), so
you need the appropriate font on the client machine.
And then there's file formats like PDF that include the fonts WITH the
document itself, completely eliminating this headache.
Hope I haven't made matters still worse!
william zeitler
-----Original Message-----
From: James Tauber [mailto:jtauber at jtauber.com]
Sent: Friday, January 07, 2005 12:03 PM
To: William Zeitler; b-greek at lists.ibiblio.org
Subject: Re: [B-Greek] UTF
I deliberated over whether to respond to the whole list and decided to do so
- apologies for being off-topic but it's the source of some confusion on
this list so thought it would be helpful.
On 8/1/05 3:30 AM, "William Zeitler" <william at faithfulbible.com> wrote:
>> the term UTF (really there is UTF-7, UTF-8 and UTF-16) applies to
document
>> encoding, not fonts.
>
> Actually, both. You need both the document and the font to use the same
> encoding schema (e.g. both the document and the font must agree that
> 04ff29bHEX == 'alpha with a rough breather'). If the document uses an
> encoding schema that doesn't match the font's, you get a mess.
You are confusing the character code with the encoding.
The Unicode spec says that alpha with rough breathing is at code point 7937
(i.e. 0x1F01 in hex)
This is the only mapping the font file itself needs to know.
However, when reading or writing a document, you (or rather, the editor you
are using) needs to decide how to represent that number 7937.
UTF-16 would represent it 1F 01 or 01 1F
UTF-8 would represent it E1 BC 81
The font doesn't need to know any of this - all it knows is alpha with rough
breathing is code point 7937. The character encoding UTF-8 decides that 7937
will, in a document, be expressed as E1 BC 81
Note also that this is all separate from keyboard mappings.
* A KEYBOARD MAPPING maps keys to characters
* A CODED CHARACTER SET (like Unicode) maps characters to numbers
* A CHARACTER ENCODING (like UTF-8) maps numbers to bytes in a file
> Even within Unicode there are different schemas (e.g. Normalization Form C
> vs. D, which are specifically concerned with diacritical marks).
Right. There is a difference between alpha with rough breathing and alpha +
rough breathing. Note that this distinction can exist in any coded character
set with diacritics whether Unicode or not. Also note that this is
orthogonal to the choice of character encoding.
James Tauber
More information about the B-Greek
mailing list