ASF Bugzilla – Attachment 26087 Details for
Bug 50006
[PATCH] ttf2svg outputs hkern elements outside (user-provided) glyph range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixed glyph ID confusion
kerning_range_v3.diff (text/plain), 1.84 KB, created by
Charles Huber
on 2010-09-27 14:51:08 UTC
(
hide
)
Description:
Fixed glyph ID confusion
Filename:
MIME Type:
Creator:
Charles Huber
Created:
2010-09-27 14:51:08 UTC
Size:
1.84 KB
patch
obsolete
>Index: SVGFont.java >=================================================================== >--- SVGFont.java (revision 1001571) >+++ SVGFont.java (working copy) >@@ -21,6 +21,8 @@ > > import java.io.FileOutputStream; > import java.io.PrintStream; >+import java.util.Set; >+import java.util.TreeSet; > > import org.apache.batik.svggen.font.table.CmapFormat; > import org.apache.batik.svggen.font.table.Feature; >@@ -370,6 +372,7 @@ > } > > // Include our requested range >+ Set glyphSet = new TreeSet(); > for (int i = first; i <= last; i++) { > int glyphIndex = cmapFmt.mapCharCode(i); > // ps.println(String.valueOf(i) + " -> " + String.valueOf(glyphIndex)); >@@ -377,6 +380,9 @@ > // sb.append(font.getGlyphs()[glyphIndex].toString() + "\n"); > > if (glyphIndex > 0) { >+ // add glyph ID to set so we can filter later >+ glyphSet.add(glyphIndex); >+ > ps.println(getGlyphAsSVG( > font, > font.getGlyph(glyphIndex), >@@ -396,7 +402,12 @@ > KernSubtable kst = kern.getSubtable(0); > PostTable post = (PostTable) font.getTable(Table.post); > for (int i = 0; i < kst.getKerningPairCount(); i++) { >- ps.println(getKerningPairAsSVG(kst.getKerningPair(i), post)); >+ int left = kst.getKerningPair(i).getLeft(); >+ int right = kst.getKerningPair(i).getRight(); >+ // check if left and right are both in our glyph set >+ if (glyphSet.contains(left) && glyphSet.contains(right)) { >+ ps.println(getKerningPairAsSVG(kst.getKerningPair(i), post)); >+ } > } > } > } catch (Exception e) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 50006
:
26077
|
26082
|
26087
|
26103