mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-04 08:25:12 +00:00
put advances back as were,
fix font data size
This commit is contained in:
@@ -14,35 +14,29 @@ import java.util.List;
|
||||
public class IggyCharAdvances implements StructureInterface {
|
||||
|
||||
List<Float> advances;
|
||||
private List<IggyShape> glyphs;
|
||||
private long charCount;
|
||||
|
||||
public List<Float> getScales() {
|
||||
return advances;
|
||||
}
|
||||
|
||||
public IggyCharAdvances(ReadDataStreamInterface stream, List<IggyShape> glyphs) throws IOException {
|
||||
this.glyphs = glyphs;
|
||||
public IggyCharAdvances(ReadDataStreamInterface stream, long charCount) throws IOException {
|
||||
this.charCount = charCount;
|
||||
readFromDataStream(stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromDataStream(ReadDataStreamInterface stream) throws IOException {
|
||||
advances = new ArrayList<>();
|
||||
for (int i = 0; i < glyphs.size(); i++) {
|
||||
if (glyphs.get(i) != null) {
|
||||
advances.add(stream.readFloat());
|
||||
} else {
|
||||
advances.add(null);
|
||||
}
|
||||
for (int i = 0; i < charCount; i++) {
|
||||
advances.add(stream.readFloat());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToDataStream(WriteDataStreamInterface stream) throws IOException {
|
||||
for (int i = 0; i < advances.size(); i++) {
|
||||
if (advances.get(i) != null) {
|
||||
stream.writeFloat(advances.get(i));
|
||||
}
|
||||
stream.writeFloat(advances.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public class IggyFont extends IggyTag {
|
||||
}
|
||||
if (abs_start_of_scale != 0) {
|
||||
s.seek(abs_start_of_scale, SeekMode.SET);
|
||||
charScales = new IggyCharAdvances(s, glyphs);
|
||||
charScales = new IggyCharAdvances(s, char_count);
|
||||
}
|
||||
if (abs_start_of_kern != 0) {
|
||||
s.seek(abs_start_of_kern, SeekMode.SET);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class IggySwf implements StructureInterface {
|
||||
if (next_offset == 1) {
|
||||
font_data_sizes[i] = hdr.getFontEndAddress() - font_data_addresses[i];
|
||||
} else {
|
||||
font_data_sizes[i] = next_offset - offset;
|
||||
font_data_sizes[i] = next_offset - offset + 8;
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
@@ -130,7 +130,7 @@ public class IggySwf implements StructureInterface {
|
||||
text_data_sizes.add(hdr.getFontEndAddress() - text_addr);
|
||||
break;
|
||||
} else {
|
||||
text_data_sizes.add(next_offset - offset);
|
||||
text_data_sizes.add(next_offset - offset + 8);
|
||||
}
|
||||
}
|
||||
s.readUI64(); //1
|
||||
|
||||
Reference in New Issue
Block a user