mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-17 13:31:53 +00:00
character adding problem fixed
This commit is contained in:
@@ -343,6 +343,19 @@ public class DefineText2Tag extends TextTag {
|
||||
if (font == null) {
|
||||
throw new TextParseException("Font not defined", lexer.yyline());
|
||||
}
|
||||
|
||||
for (int i = 0; i < txt.length(); i++) {
|
||||
char c = txt.charAt(i);
|
||||
|
||||
if (!font.containsChar(c)) {
|
||||
if (!missingCharHandler.handle(font, c)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return setFormattedText(missingCharHandler, formattedText, texts);
|
||||
}
|
||||
}
|
||||
|
||||
TEXTRECORD tr = new TEXTRECORD();
|
||||
textRecords.add(tr);
|
||||
if (fontId > -1) {
|
||||
@@ -374,16 +387,6 @@ public class DefineText2Tag extends TextTag {
|
||||
nextChar = txt.charAt(i + 1);
|
||||
}
|
||||
|
||||
if (!font.containsChar(c)) {
|
||||
if (!missingCharHandler.handle(font, c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (nextChar != null && !font.containsChar(nextChar)) {
|
||||
if (!missingCharHandler.handle(font, nextChar)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
tr.glyphEntries[i] = new GLYPHENTRY();
|
||||
tr.glyphEntries[i].glyphIndex = font.charToGlyph(c);
|
||||
|
||||
@@ -410,7 +413,6 @@ public class DefineText2Tag extends TextTag {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setModified(true);
|
||||
|
||||
@@ -349,6 +349,19 @@ public class DefineTextTag extends TextTag {
|
||||
if (font == null) {
|
||||
throw new TextParseException("Font not defined", lexer.yyline());
|
||||
}
|
||||
|
||||
for (int i = 0; i < txt.length(); i++) {
|
||||
char c = txt.charAt(i);
|
||||
|
||||
if (!font.containsChar(c)) {
|
||||
if (!missingCharHandler.handle(font, c)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return setFormattedText(missingCharHandler, formattedText, texts);
|
||||
}
|
||||
}
|
||||
|
||||
TEXTRECORD tr = new TEXTRECORD();
|
||||
textRecords.add(tr);
|
||||
if (fontId > -1) {
|
||||
@@ -380,16 +393,6 @@ public class DefineTextTag extends TextTag {
|
||||
nextChar = txt.charAt(i + 1);
|
||||
}
|
||||
|
||||
if (!font.containsChar(c)) {
|
||||
if (!missingCharHandler.handle(font, c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (nextChar != null && !font.containsChar(nextChar)) {
|
||||
if (!missingCharHandler.handle(font, nextChar)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
tr.glyphEntries[i] = new GLYPHENTRY();
|
||||
tr.glyphEntries[i].glyphIndex = font.charToGlyph(c);
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
|
||||
return defaultFontName;
|
||||
}
|
||||
|
||||
public void shiftGlyphIndices(int fontId, int startIndex) {
|
||||
protected void shiftGlyphIndices(int fontId, int startIndex) {
|
||||
for (Tag t : swf.tags) {
|
||||
List<TEXTRECORD> textRecords = null;
|
||||
if (t instanceof DefineTextTag) {
|
||||
@@ -197,9 +197,11 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
|
||||
if (tr.styleFlagsHasFont) {
|
||||
curFontId = tr.fontId;
|
||||
}
|
||||
|
||||
if (curFontId != fontId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (GLYPHENTRY en : tr.glyphEntries) {
|
||||
if (en == null) { //Currently edited
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user