View | Details | Raw Unified | Return to bug 50006
Collapse All | Expand All

(-)sources/org/apache/batik/svggen/font/SVGFont.java (-1 / +12 lines)
Lines 21-26 Link Here
21
21
22
import java.io.FileOutputStream;
22
import java.io.FileOutputStream;
23
import java.io.PrintStream;
23
import java.io.PrintStream;
24
import java.util.Set;
25
import java.util.HashSet;
24
26
25
import org.apache.batik.svggen.font.table.CmapFormat;
27
import org.apache.batik.svggen.font.table.CmapFormat;
26
import org.apache.batik.svggen.font.table.Feature;
28
import org.apache.batik.svggen.font.table.Feature;
Lines 370-375 Link Here
370
            }
372
            }
371
373
372
            // Include our requested range
374
            // Include our requested range
375
            Set glyphSet = new HashSet();
373
            for (int i = first; i <= last; i++) {
376
            for (int i = first; i <= last; i++) {
374
                int glyphIndex = cmapFmt.mapCharCode(i);
377
                int glyphIndex = cmapFmt.mapCharCode(i);
375
                //        ps.println(String.valueOf(i) + " -> " + String.valueOf(glyphIndex));
378
                //        ps.println(String.valueOf(i) + " -> " + String.valueOf(glyphIndex));
Lines 377-382 Link Here
377
                //        sb.append(font.getGlyphs()[glyphIndex].toString() + "\n");
380
                //        sb.append(font.getGlyphs()[glyphIndex].toString() + "\n");
378
381
379
                if (glyphIndex > 0) {
382
                if (glyphIndex > 0) {
383
                    // add glyph ID to set so we can filter later
384
                    glyphSet.add(glyphIndex);
385
380
                    ps.println(getGlyphAsSVG(
386
                    ps.println(getGlyphAsSVG(
381
                        font,
387
                        font,
382
                        font.getGlyph(glyphIndex),
388
                        font.getGlyph(glyphIndex),
Lines 396-402 Link Here
396
                KernSubtable kst = kern.getSubtable(0);
402
                KernSubtable kst = kern.getSubtable(0);
397
                PostTable post = (PostTable) font.getTable(Table.post);
403
                PostTable post = (PostTable) font.getTable(Table.post);
398
                for (int i = 0; i < kst.getKerningPairCount(); i++) {
404
                for (int i = 0; i < kst.getKerningPairCount(); i++) {
399
                    ps.println(getKerningPairAsSVG(kst.getKerningPair(i), post));
405
                    int left = kst.getKerningPair(i).getLeft();
406
                    int right = kst.getKerningPair(i).getRight();
407
                    // check if left and right are both in our glyph set
408
                    if (glyphSet.contains(left) && glyphSet.contains(right)) {
409
                        ps.println(getKerningPairAsSVG(kst.getKerningPair(i), post));
410
                    }
400
                }
411
                }
401
            }
412
            }
402
        } catch (Exception e) {
413
        } catch (Exception e) {

Return to bug 50006