[#1348] Cannot properly export frame with cyrillic symbols to SVG

This commit is contained in:
honfika@gmail.com
2017-02-06 13:51:49 +01:00
parent 871f4f52d9
commit 3e99d19a1d
4 changed files with 8 additions and 7 deletions

View File

@@ -201,7 +201,7 @@ public class FrameExporter {
final Color fbackgroundColor = null;
new RetryTask(() -> {
int frame = fframes.get(fi);
File f = new File(foutdir + File.separator + frame + ".svg");
File f = new File(foutdir + File.separator + (frame + 1) + ".svg");
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(f))) {
ExportRectangle rect = new ExportRectangle(tim.displayRect);
rect.xMax *= settings.zoom;
@@ -361,7 +361,7 @@ public class FrameExporter {
} else {
for (Integer frame : fframes) {
new RetryTask(() -> {
File f = new File(foutdir + File.separator + frame + ".swf");
File f = new File(foutdir + File.separator + (frame + 1) + ".swf");
Frame fn = (Frame) tim.getFrame(frame);
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(f))) {

View File

@@ -74,7 +74,7 @@ public class SVGExporter {
public Map<Tag, String> exportedTags = new HashMap<>();
public Map<Tag, Map<Character, String>> exportedChars = new HashMap<>();
public Map<Tag, Map<Integer, String>> exportedChars = new HashMap<>();
private final Map<String, Integer> lastIds = new HashMap<>();

View File

@@ -736,11 +736,11 @@ public abstract class TextTag extends DrawableTag {
char ch = font.glyphToChar(entry.glyphIndex);
String charId = null;
Map<Character, String> chs;
Map<Integer, String> chs;
if (exporter.exportedChars.containsKey(font)) {
chs = exporter.exportedChars.get(font);
if (chs.containsKey(ch)) {
charId = chs.get(ch);
if (chs.containsKey(entry.glyphIndex)) {
charId = chs.get(entry.glyphIndex);
}
} else {
chs = new HashMap<>();
@@ -753,7 +753,7 @@ public abstract class TextTag extends DrawableTag {
SVGShapeExporter shapeExporter = new SVGShapeExporter(swf, shape, exporter, null, colorTransform, zoom);
shapeExporter.export();
exporter.endGroup();
chs.put(ch, charId);
chs.put(entry.glyphIndex, charId);
}
Element charImage = exporter.addUse(mat, bounds, charId, null);