<div dir="ltr">Hi,<div>Here I think it would be clearer to remove the out commented "]" !</div><div><br></div><div>Karl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 2:57 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tobias Pape uploaded a new version of TrueType to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/TrueType-topa.40.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/TrueType-topa.40.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: TrueType-topa.40<br>
Author: topa<br>
Time: 1 September 2015, 2:57:19.158 pm<br>
UUID: 9abe9053-6bf7-4a8a-b769-caf1d6bbbc97<br>
Ancestors: TrueType-topa.39<br>
<br>
Use all glyphs in a Font, not just 256 (fix by Vasya Chajko)<br>
<br>
=============== Diff against TrueType-topa.39 ===============<br>
<br>
Item was changed:<br>
----- Method: TTCFontReader>>processCharMap: (in category 'as yet unclassified') -----<br>
processCharMap: assoc<br>
"Process the given character map"<br>
<br>
| glyph cmap encode0 encode1 char value null |<br>
cmap := assoc value.<br>
null := (glyphs at: (cmap at: Character space asUnicode + 1) + 1) copy.<br>
null contours: #().<br>
<br>
encode0 := Array new: 256 withAll: glyphs first.<br>
encode1 := Array new: 65536 withAll: glyphs first.<br>
<br>
0 to: 255 do: [:i |<br>
char := Character value: i.<br>
glyph := glyphs at: (cmap at: char asUnicode + 1) + 1.<br>
encode0 at: i+1 put: glyph.<br>
].<br>
Character separators do: [:c |<br>
encode0 at: (c asciiValue + 1) put: null.<br>
].<br>
0 to: 65536 - 1 do: [:i |<br>
value := cmap at: i+1.<br>
value = 65535 ifFalse: [ "???"<br>
| g |<br>
+ g := glyphs at: value+1 ifAbsent: [ null. ].<br>
- g := glyphs at: value+1.<br>
(g isKindOf: TTCompositeGlyph) ifFalse: [<br>
encode1 at: i+1 put: g.<br>
] ifTrue: [<br>
g basicGlyphs: (((glyphs at: value+1) basicGlyphs) collect: [:t | t key->(glyphs at: (t value glyphIndex+1))]).<br>
encode1 at: i+1 put: g<br>
].<br>
]<br>
].<br>
<br>
^ {encode0. encode1}.<br>
!<br>
<br>
Item was changed:<br>
----- Method: TTFontReader>>decodeCmapFmtTable: (in category 'private') -----<br>
decodeCmapFmtTable: entry<br>
| cmapFmt length entryCount segCount segments offset cmap firstCode |<br>
cmapFmt := entry nextUShort.<br>
length := entry nextUShort.<br>
entry skip: 2. "skip version"<br>
<br>
cmapFmt = 0 ifTrue: "byte encoded table"<br>
[length := length - 6. "should be always 256"<br>
length <= 0 ifTrue: [^ nil]. "but sometimes, this table is empty"<br>
cmap := Array new: length.<br>
entry nextBytes: length into: cmap startingAt: entry offset.<br>
^ cmap].<br>
<br>
cmapFmt = 4 ifTrue: "segment mapping to deltavalues"<br>
[segCount := entry nextUShort // 2.<br>
entry skip: 6. "skip searchRange, entrySelector, rangeShift"<br>
segments := Array new: segCount.<br>
segments := (1 to: segCount) collect: [:e | Array new: 4].<br>
1 to: segCount do: [:i | (segments at: i) at: 2 put: entry nextUShort]. "endCount"<br>
entry skip: 2. "skip reservedPad"<br>
1 to: segCount do: [:i | (segments at: i) at: 1 put: entry nextUShort]. "startCount"<br>
1 to: segCount do: [:i | (segments at: i) at: 3 put: entry nextShort]. "idDelta"<br>
offset := entry offset.<br>
1 to: segCount do: [:i | (segments at: i) at: 4 put: entry nextUShort]. "idRangeOffset"<br>
entryCount := segments inject: 0 into: [:max :seg | max max: seg second].<br>
cmap := Array new: entryCount+1 withAll: 0..<br>
segments withIndexDo:<br>
[:seg :si | | code |<br>
seg first to: seg second do:<br>
[:i |<br>
+ seg last > 0 ifTrue:<br>
- i < 256 ifTrue:<br>
- [seg last > 0 ifTrue:<br>
["offset to glypthIdArray - this is really C-magic!!"<br>
entry offset: i - seg first - 1 * 2 + seg last + si + si + offset.<br>
code := entry nextUShort.<br>
code > 0 ifTrue: [code := code + seg third]]<br>
ifFalse:<br>
["simple offset"<br>
code := i + seg third].<br>
+ cmap at: i + 1 put: code"]"]].<br>
- cmap at: i + 1 put: code]]].<br>
^ cmap].<br>
<br>
cmapFmt = 6 ifTrue: "trimmed table"<br>
[firstCode := entry nextUShort.<br>
entryCount := entry nextUShort.<br>
cmap := Array new: entryCount + firstCode withAll: 0.<br>
entryCount timesRepeat:<br>
[cmap at: (firstCode := firstCode + 1) put: entry nextUShort].<br>
^ cmap].<br>
^ nil!<br>
<br>
<br>
</blockquote></div><br></div>