ASF Bugzilla – Attachment 26103 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]
Performance improved
Batik-Bug50006-Patch.patch (text/plain), 1.96 KB, created by
Helder Magalhães
on 2010-09-30 01:40:47 UTC
(
hide
)
Description:
Performance improved
Filename:
MIME Type:
Creator:
Helder Magalhães
Created:
2010-09-30 01:40:47 UTC
Size:
1.96 KB
patch
obsolete
>Index: sources/org/apache/batik/svggen/font/SVGFont.java >=================================================================== >--- sources/org/apache/batik/svggen/font/SVGFont.java (revision 1002941) >+++ sources/org/apache/batik/svggen/font/SVGFont.java (working copy) >@@ -21,6 +21,8 @@ > > import java.io.FileOutputStream; > import java.io.PrintStream; >+import java.util.Set; >+import java.util.HashSet; > > 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 HashSet(); > 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