This is a segment of page 4 from the XPS sample file "\Office2007\Office2007_BULLETS.xps".


<Glyphs Name="a457" Fill="#FF000000"
FontUri="/Resources/Fonts/font_8.ttf" FontRenderingEmSize="10.06"
StyleSimulations="None" OriginX="299.62" OriginY="218.27"


ATTENTION: UnicodeString is a "." only and there is no Indices attr.

In which way this "." is encoded is determined by the mapping way in its corresponding fontfile. (UnicodeString is not a "unicode" string. )

The dumped result of font_8.ttf is that:



( part of 'cmap' table )

Subtable 2. Platform ID: 3
Specific ID: 0
'cmap' Offset: 0x0000011A
->Format: 4 : Segment mapping to delta values
Length: 32
Version: 0
segCount: 2 (X2 = 4)
searchRange: 4
entrySelector: 1
rangeShift: 0
Seg 1 : St = F0B7, En = F0B7, D = 4033, RO = 0, gId# = N/A
Seg 2 : St = FFFF, En = FFFF, D = 1, RO = 0, gId# = N/A

Which Means:
1. Char F0B7 -> Index 120



Because the true encoded way of UnicodeString is determined by the mapping way in font file.

So I have to treat "." as a Symbol mapping way. But the value of "." is 0x00B7 not a symbol mapping code.

If I have to change UnicodeString myself

If I changed the UnicodeString , what should I do when the UnicodeString is set to "#&XF0B7"


1. What is the correct true meaning of UnicodeString

2. How can I get the way in which font file is created in XPS file

Thanks in advance.

Re: XML Paper Specification (XPS) Problems about UnicodeString and FontUri

Feng Yuan - MSFT

There is a section of the XPS spec which seems to be relevant, but not exactly:

When processing <Glyphs> elements that reference a cmap (3,0) encoding font, consumers MUST be prepared for the case in which the UnicodeString attribute contains character codes instead of PUA codepoints [M2.57]. This condition is indicated by an unsuccessful Unicode lookup of the codepoint specified in the Unicode string in the cmap (3,0) table. In this case, the correct glyph index is computed by following the general recommendations of the OpenType specification.

When processing <Glyphs> elements that use this compatibility encoding, character codes in the range 0x20-0xff are mapped to PUA codepoints. Therefore, character codes in the range 0x80-0x9f are not considered non-printable Unicode control codes.

Re: XML Paper Specification (XPS) Problems about UnicodeString and FontUri

Jesse McGatha

UnicodeString contains an array of Unicode scalar values, represented as UTF-16 code units, with standard XML escaping for XML reserved characters. Each scalar value is mapped via the cmap table to the proper glyph index. See section 5.1.4 of the XPS specification for additional information.

Re: XML Paper Specification (XPS) Problems about UnicodeString and FontUri


Hi, all

I have solved this problem using (according to maxGlyfID from maxp and cmap) Index directly to download all need glyf data from font.