Issue #903 FLA export - fix for missing fontName, fix last frame when no last ShowFrameTag present

This commit is contained in:
Jindra Petřík
2015-05-30 07:11:50 +02:00
parent 51f1e11179
commit 58c24aa746
2 changed files with 33 additions and 2 deletions

View File

@@ -1788,7 +1788,25 @@ public class XFLConverter {
boolean lastShapeTween = false;
MorphShapeTag shapeTweener = null;
for (Tag t : timelineTags) {
//Add ShowFrameTag to the end when there is one last missing
List<Tag> timTags = new ArrayList<>(timelineTags);
boolean needsFrameAdd = false;
SWF swf = null;
for (int i = timTags.size() - 1; i >= 0; i--) {
if (timTags.get(i) instanceof ShowFrameTag) {
break;
}
if (timTags.get(i) instanceof PlaceObjectTypeTag) {
needsFrameAdd = true;
swf = timTags.get(i).getSwf();
break;
}
}
if (needsFrameAdd) {
timTags.add(new ShowFrameTag(swf));
}
for (Tag t : timTags) {
if (t instanceof PlaceObjectTypeTag) {
PlaceObjectTypeTag po = (PlaceObjectTypeTag) t;
if (po.getDepth() == depth) {
@@ -1936,6 +1954,9 @@ public class XFLConverter {
if (fontName == null) {
fontName = font.getFontNameIntag();
}
if (fontName == null) {
fontName = FontTag.defaultFontName;
}
int fontStyle = font.getFontStyle();
String installedFont;
if ((installedFont = FontTag.isFontFamilyInstalled(fontName)) != null) {
@@ -2420,6 +2441,9 @@ public class XFLConverter {
if ((fontName == null) && (font != null)) {
fontName = font.getFontNameIntag();
}
if (fontName == null) {
fontName = FontTag.defaultFontName;
}
int fontStyle = 0;
if (font != null) {
fontStyle = font.getFontStyle();
@@ -2565,6 +2589,9 @@ public class XFLConverter {
if (fontName == null) {
fontName = ft.getFontNameIntag();
}
if (fontName == null) {
fontName = FontTag.defaultFontName;
}
italic = ft.isItalic();
bold = ft.isBold();
size = det.fontHeight;
@@ -2997,6 +3024,7 @@ public class XFLConverter {
logger.log(Level.SEVERE, "Error during ActionScript3 export", ex);
}
}
}
private static int normHue(double h) {
@@ -3216,6 +3244,9 @@ public class XFLConverter {
if (fontName == null) {
fontName = ft.getFontNameIntag();
}
if (fontName == null) {
fontName = FontTag.defaultFontName;
}
italic = ft.isItalic();
bold = ft.isBold();
size = det.fontHeight;