mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-01 16:14:53 +00:00
set font creation and modification time to the modification time of the swf file
This commit is contained in:
@@ -29,6 +29,7 @@ package fontastic;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.doubletype.ossa.Engine;
|
||||
import org.doubletype.ossa.OutOfRangeException;
|
||||
@@ -201,6 +202,14 @@ public class Fontastic {
|
||||
m_engine.setCopyrightYear(copyrightYear);
|
||||
}
|
||||
|
||||
public void setCreationDate(Date date) {
|
||||
m_engine.setCreationDate(date);
|
||||
}
|
||||
|
||||
public void setModificationDate(Date date) {
|
||||
m_engine.setModificationDate(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version of the font (default is "0.1").
|
||||
*/
|
||||
|
||||
@@ -187,6 +187,22 @@ public class Engine {
|
||||
m_typeface.setCopyrightYear(a_value);
|
||||
}
|
||||
|
||||
public void setCreationDate(Date a_value) {
|
||||
if (m_typeface == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_typeface.setCreationDate(a_value);
|
||||
}
|
||||
|
||||
public void setModificationDate(Date a_value) {
|
||||
if (m_typeface == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_typeface.setModificationDate(a_value);
|
||||
}
|
||||
|
||||
public void setFontFamilyName(String a_value) {
|
||||
if (m_typeface == null) {
|
||||
return;
|
||||
|
||||
@@ -35,6 +35,7 @@ package org.doubletype.ossa.module;
|
||||
import java.awt.Point;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.doubletype.ossa.adapter.EContour;
|
||||
import org.doubletype.ossa.adapter.EContourPoint;
|
||||
@@ -52,6 +53,10 @@ public class GlyphFile {
|
||||
|
||||
private String m_copyrightYear;
|
||||
|
||||
private Date m_creationDate;
|
||||
|
||||
private Date m_modificationDate;
|
||||
|
||||
private String m_license;
|
||||
|
||||
private Integer m_advanceWidth = null;
|
||||
@@ -149,6 +154,22 @@ public class GlyphFile {
|
||||
return m_copyrightYear;
|
||||
}
|
||||
|
||||
public void setCreationDate(Date a_value) {
|
||||
m_creationDate = a_value;
|
||||
}
|
||||
|
||||
public Date getCreationDate() {
|
||||
return m_creationDate;
|
||||
}
|
||||
|
||||
public void setModificationDate(Date a_value) {
|
||||
m_modificationDate = a_value;
|
||||
}
|
||||
|
||||
public Date getModificationDate() {
|
||||
return m_modificationDate;
|
||||
}
|
||||
|
||||
public void setAdvanceWidth(int a_width) {
|
||||
m_advanceWidth = a_width;
|
||||
}
|
||||
|
||||
@@ -389,6 +389,8 @@ public class TypefaceFile extends GlyphFile {
|
||||
|
||||
writer.setFontFamilyName(fontFamilyName);
|
||||
writer.setCopyrightYear(getCopyrightYear());
|
||||
writer.setCreationDate(getCreationDate());
|
||||
writer.setModificationDate(getModificationDate());
|
||||
writer.setFontVersion(getVersion());
|
||||
writer.setManufacturer(getAuthor());
|
||||
writer.setAscent((int) getAscender());
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.io.RandomAccessFile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author e.e
|
||||
@@ -225,6 +226,14 @@ public class FontFileWriter extends FontFormatWriter {
|
||||
public TTGlyph getGlyph(int a_index) {
|
||||
return m_glyf.getGlyph(a_index);
|
||||
}
|
||||
|
||||
public void setCreationDate(Date a_date) {
|
||||
m_head.setCreationDate(a_date);
|
||||
}
|
||||
|
||||
public void setModificationDate(Date a_date) {
|
||||
m_head.setModificationDate(a_date);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds character mapping to
|
||||
|
||||
@@ -73,6 +73,10 @@ public class HeadWriter extends FontFormatWriter {
|
||||
private Point m_min = new Point(0, 0);
|
||||
|
||||
private Point m_max = new Point(0, 0);
|
||||
|
||||
private Date m_creationDate = new Date();
|
||||
|
||||
private Date m_modificationDate = m_creationDate;
|
||||
|
||||
public HeadWriter() {
|
||||
super();
|
||||
@@ -109,6 +113,14 @@ public class HeadWriter extends FontFormatWriter {
|
||||
m_max.y = a_value.y;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCreationDate(Date a_date) {
|
||||
m_creationDate = a_date;
|
||||
}
|
||||
|
||||
public void setModificationDate(Date a_date) {
|
||||
m_modificationDate = a_date;
|
||||
}
|
||||
|
||||
public void write() throws IOException {
|
||||
// table version number
|
||||
@@ -130,8 +142,8 @@ public class HeadWriter extends FontFormatWriter {
|
||||
writeUInt16(1024);
|
||||
|
||||
// created, modified
|
||||
writeLongDateTime(new Date());
|
||||
writeLongDateTime(new Date());
|
||||
writeLongDateTime(m_creationDate);
|
||||
writeLongDateTime(m_modificationDate);
|
||||
|
||||
writeFWord(m_min.x);
|
||||
writeFWord(m_min.y);
|
||||
|
||||
Reference in New Issue
Block a user