From: Peter Olcott on
Does TextOutW() always use UTF-16 as its basis, or are there
some other levels of indirection?

How can I tell exactly which UTF-16 characters are
represented by a typeface?


From: David Webber on

"Peter Olcott" <NoSpam(a)SeeScreen.com> wrote in message
news:MKZ%i.534$ip1.466(a)newsfe21.lga...

> Does TextOutW() always use UTF-16 as its basis,

Yes, I believe so.

> How can I tell exactly which UTF-16 characters are represented by a
> typeface?

Fonts contain lots of information about what they can do. Have a look at
the structures FONTSIGNATURE, LOCALEFONTSIGNATURE, and CHARSETINFO in the
help system.

I looked into these a while ago but my memory is vague: I wanted to find out
about support for musical flat, double sharp, etc symbols, but was
disappointed. I came to the conclusion that fonts could implement symbols
or not on an individual basis, and there was nothing to tell me if an
individual one was implemented.

[If anyone finds a way, I'd love to hear about it!]

But I think these structures, (and the APIs which fill them in) should be
able to tell you if the characters needed by a certain language are present.

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm




From: Mihai N. on
> Does TextOutW() always use UTF-16 as its basis, or are there
> some other levels of indirection?
UTF-16 always.


> How can I tell exactly which UTF-16 characters are
> represented by a typeface?
The only way to tell is by checking if there is a glyph
present for the character you want.
For that you can use GetGlyphIndices (which does not work
above BMP though), you can use ScriptGetCMap (Uniscribe)
or you can do your own ttf/otf cmap parsing.

But you should also remember that there are other things
going: ligatures (so in the font you can have a glyph for
the "xy" ligature but no "x" or "y" glyphs stand-alone)
You also have font linking/mapping/fallback/substitution
done by various Windows layers. So you can have a character
on screen that is not in the currently selected font,
but still shows ok.



--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
From: David Webber on

"Mihai N." <nmihai_year_2000(a)yahoo.com> wrote in message
news:Xns99ED35E4B4AMihaiN(a)207.46.248.16...

> For that you can use GetGlyphIndices (which does not work
> above BMP though),

Hi Mihai, a couple of questions, if I may:

Is the BMP *precisely* the set which can be represented by a single word in
UTF-16 (ie without surrogates)?

I am interested in Musical symbols - code points 1D100-1D1FF - which are
clearly outside this range.

But three useful ones are at 266D, 266E, 266F (flat, natural, sharp) - do
you reckon it should work for those?

[I'm suddenly thinking I could parse my strings at drawing time for those
characters and replace them with 'b', ' ', '#' if not present in the font.
That way titles like "Sonata in Eb" could be represented properly if the
flat character is there, and with b (a poor substitute) if it isn't.]

I don't know when unicode fonts with 1D100-1D1FF will become commonplace,
but even if they did, one would have to know where the origin of the symbol
is, in order to place it correctly with music. Do you know if there is a
standard for this?

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm






you can use ScriptGetCMap (Uniscribe)
> or you can do your own ttf/otf cmap parsing.
>
> But you should also remember that there are other things
> going: ligatures (so in the font you can have a glyph for
> the "xy" ligature but no "x" or "y" glyphs stand-alone)
> You also have font linking/mapping/fallback/substitution
> done by various Windows layers. So you can have a character
> on screen that is not in the currently selected font,
> but still shows ok.
>
>
>
> --
> Mihai Nita [Microsoft MVP, Windows - SDK]
> http://www.mihai-nita.net
> ------------------------------------------
> Replace _year_ with _ to get the real email

From: Peter Olcott on

"Mihai N." <nmihai_year_2000(a)yahoo.com> wrote in message
news:Xns99ED35E4B4AMihaiN(a)207.46.248.16...
>> Does TextOutW() always use UTF-16 as its basis, or are
>> there
>> some other levels of indirection?
> UTF-16 always.
>
>
>> How can I tell exactly which UTF-16 characters are
>> represented by a typeface?
> The only way to tell is by checking if there is a glyph
> present for the character you want.
> For that you can use GetGlyphIndices (which does not work
> above BMP though),

That is plenty good enough for the time being. It will
probably be a long time before I support any glyphs above
the BMP.

> you can use ScriptGetCMap (Uniscribe)
> or you can do your own ttf/otf cmap parsing.
>
> But you should also remember that there are other things
> going: ligatures (so in the font you can have a glyph for
> the "xy" ligature but no "x" or "y" glyphs stand-alone)
> You also have font linking/mapping/fallback/substitution
> done by various Windows layers. So you can have a
> character
> on screen that is not in the currently selected font,
> but still shows ok.
>
>
I probably would map ligature to their individual Unicode
values, and thus not retain the fact that they were
ligatures.

>
> --
> Mihai Nita [Microsoft MVP, Windows - SDK]
> http://www.mihai-nita.net
> ------------------------------------------
> Replace _year_ with _ to get the real email