• R/O
  • SSH
  • HTTPS

copper: Commit


Commit MetaInfo

Revision1592 (tree)
Time2019-12-03 15:59:47
Authormiyabe

Log Message

(empty log message)

Change Summary

Incremental Difference

--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/font/otf/OpenTypeFontSource.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/font/otf/OpenTypeFontSource.java (revision 1592)
@@ -153,7 +153,7 @@
153153 public static synchronized net.zamasoft.font.OpenTypeFont getOpenTypeFont(File file, int index) {
154154 FontFile fontFile = fileToFont.get(file);
155155 try {
156- if (fontFile != null) {
156+ if (fontFile != null && fontFile.timestamp == file.lastModified()) {
157157 return fontFile.getFont(index);
158158 }
159159 fontFile = new FontFile(file);
--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/CharacterHandler.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/CharacterHandler.java (revision 1592)
@@ -33,9 +33,16 @@
3333 public void quad(Quad quad);
3434
3535 /**
36+ * テキストを区切ります。
37+ *
38+ * <b>このメソッドはwordBreak()を呼びます。</b>
39+ */
40+ public void flush();
41+
42+ /**
3643 * 段落を終わります。
3744 *
38- * <b>このメソッドはwordBrak()を呼びます。</b>
45+ * <b>このメソッドはwordBreak()を呼びます。</b>
3946 */
40- public void flush();
47+ public void finish();
4148 }
--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/GlyphHandler.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/GlyphHandler.java (revision 1592)
@@ -45,4 +45,9 @@
4545 * 現在までのテキストを書き出します。これを明示的に呼ぶと禁則処理を無視してテキストを分断することがあります。
4646 */
4747 public void flush();
48+
49+ /**
50+ * テキストの書き出しを終了します。
51+ */
52+ public void finish();
4853 }
--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/hyphenation/impl/TextUnitizer.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/hyphenation/impl/TextUnitizer.java (revision 1592)
@@ -63,6 +63,7 @@
6363
6464 public void quad(Quad quad) {
6565 String str = quad.getString();
66+ // System.err.println("TU QUAD: " + quad + "/" + Integer.toHexString(this.prevChar));
6667 if (str == Quad.BREAK) {
6768 // CONTINUE_BEFORE, CONTINUE_AFTERを除いて文字列を区切る
6869 if (this.prevChar != 0 && this.prevChar != '\u2060') {
@@ -83,6 +84,10 @@
8384 }
8485 } else if (str == Quad.CONTINUE_AFTER) {
8586 // 前の文字として扱う(前の文字列にくっつける...</span>)
87+ if (this.prevChar == '\u200B') {
88+ this.internalFlush();
89+ this.prevChar = '\u2060';
90+ }
8691 } else if (str.length() == 0) {
8792 // 前の文字として扱う(前後にくっつける)
8893 if (this.prevChar == '\u200B') {
@@ -115,6 +120,14 @@
115120 this.internalFlush();
116121 }
117122
123+ public void finish() {
124+ if (this.beforeQuad != null) {
125+ this.glyphHandler.quad(this.beforeQuad);
126+ this.beforeQuad = null;
127+ }
128+ this.glyphHandler.finish();
129+ }
130+
118131 /**
119132 *
120133 * @param c1
--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/layout/FilterCharacterHandler.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/layout/FilterCharacterHandler.java (revision 1592)
@@ -31,6 +31,10 @@
3131 this.characterHandler.flush();
3232 }
3333
34+ public void finish() {
35+ this.characterHandler.flush();
36+ }
37+
3438 public void quad(Quad quad) {
3539 this.characterHandler.quad(quad);
3640 }
--- copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/layout/SimpleLayoutGlyphHandler.java (revision 1591)
+++ copper/trunk/sakae/sakae-core/src/main/java/jp/cssj/sakae/gc/text/layout/SimpleLayoutGlyphHandler.java (revision 1592)
@@ -96,4 +96,8 @@
9696 public void flush() {
9797 // ignore
9898 }
99+
100+ public void finish() {
101+ // ignore
102+ }
99103 }
--- copper/trunk/sakae/sakae-pdf/src/main/java/jp/cssj/sakae/pdf/font/FontManagerImpl.java (revision 1591)
+++ copper/trunk/sakae/sakae-pdf/src/main/java/jp/cssj/sakae/pdf/font/FontManagerImpl.java (revision 1592)
@@ -243,5 +243,10 @@
243243 this.glyphBreak();
244244 this.glyphHandler.flush();
245245 }
246+
247+ public void finish() {
248+ this.glyphBreak();
249+ this.glyphHandler.finish();
250+ }
246251 }
247252 }
\ No newline at end of file
--- copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/FontFile.java (revision 1591)
+++ copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/FontFile.java (revision 1592)
@@ -19,6 +19,8 @@
1919 * @version $Id: FontFile.java 1352 2014-12-27 02:28:47Z miyabe $
2020 */
2121 public class FontFile {
22+ public final long timestamp;
23+
2224 private final OpenTypeFont[] fonts;
2325
2426 private final long[] offsets;
@@ -34,6 +36,7 @@
3436 * @throws IOException
3537 */
3638 public FontFile(File file) throws IOException {
39+ this.timestamp = file.lastModified();
3740 RandomAccessFile raf = new BufferedRandomAccessFile(file, "r");
3841 try {
3942 byte[] tagBytes = new byte[4];
--- copper/trunk/sakae/zs-resolver/src/main/java/jp/cssj/resolver/helpers/AbstractSource.java (revision 1591)
+++ copper/trunk/sakae/zs-resolver/src/main/java/jp/cssj/resolver/helpers/AbstractSource.java (revision 1592)
@@ -38,4 +38,8 @@
3838 public void close() {
3939 // ignore
4040 }
41+
42+ public String toString() {
43+ return this.uri.toString();
44+ }
4145 }
--- copper/trunk/sakae/zs-resolver/src/main/java/jp/cssj/resolver/helpers/SourceWrapper.java (revision 1591)
+++ copper/trunk/sakae/zs-resolver/src/main/java/jp/cssj/resolver/helpers/SourceWrapper.java (revision 1592)
@@ -69,4 +69,8 @@
6969 public boolean isReader() throws IOException {
7070 return this.source.isReader();
7171 }
72+
73+ public String toString() {
74+ return this.source.toString();
75+ }
7276 }
Show on old repository browser