• R/O
  • SSH
  • HTTPS

copper: Commit


Commit MetaInfo

Revision1582 (tree)
Time2018-12-25 14:05:30
Authormiyabe

Log Message

(empty log message)

Change Summary

Incremental Difference

--- copper/trunk/sakae/sakae-pdf/src/example/java/jp/cssj/sakae/example/FontTest.java (revision 1581)
+++ copper/trunk/sakae/sakae-pdf/src/example/java/jp/cssj/sakae/example/FontTest.java (nonexistent)
@@ -1,18 +0,0 @@
1-package jp.cssj.sakae.example;
2-
3-import java.awt.Font;
4-import java.io.File;
5-
6-import jp.cssj.sakae.font.otf.OpenTypeFontSource;
7-import jp.cssj.sakae.gc.font.FontStyle;
8-
9-/**
10- * @author MIYABE Tatsuhiko
11- * @version $Id: AlphaDemo.java 1565 2018-07-04 11:51:25Z miyabe $
12- */
13-public class FontTest {
14- public static void main(String[] args) throws Exception {
15- File file = new File("Apple Symbols.ttf");
16- OpenTypeFontSource otf = new OpenTypeFontSource(file, 0, FontStyle.DIRECTION_TB);
17- }
18-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/cff/Type2CharString.java (revision 1581)
+++ copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/cff/Type2CharString.java (revision 1582)
@@ -146,14 +146,7 @@
146146 boolean closed = true;
147147 this.operandStack.clear();
148148 this.execDepth = 0;
149- int k = 0;
150149 while ((op = this.scanOperator()) != ENDCHAR) {
151- if (DEBUG) {
152- if (++k > 1512) {
153- break;
154- }
155- System.err.println(Integer.toHexString(op) + "/" + this.operandStack.size());
156- }
157150 switch (op) {
158151 case RMOVETO: {
159152 if (!closed) {
@@ -163,15 +156,15 @@
163156 }
164157 closed = true;
165158 }
166- cx += this.operandStack.get(0);
167- cy += -this.operandStack.get(1);
159+ cx += this.operandStack.get(this.operandStack.size() - 2);
160+ cy += -this.operandStack.get(this.operandStack.size() - 1);
168161 path.moveTo(cx, cy);
169162 if (DEBUG) {
170- System.err.println("moveTo " + cx + " " + cy);
163+ System.err.println("rmoveto " + cx+" "+ cy);
171164 }
172165 this.operandStack.writeTo(buff, op, 2);
173166 this.operandStack.clear();
174- }
167+ }
175168 break;
176169 case HMOVETO: {
177170 if (!closed) {
@@ -181,10 +174,10 @@
181174 }
182175 closed = true;
183176 }
184- cx += this.operandStack.get(0);
177+ cx += this.operandStack.get(this.operandStack.size() - 1);
185178 path.moveTo(cx, cy);
186179 if (DEBUG) {
187- System.err.println("moveTo " + cx + " " + cy);
180+ System.err.println("hmoveTo " + cx + " " + cy);
188181 }
189182 this.operandStack.writeTo(buff, op, 1);
190183 this.operandStack.clear();
@@ -198,10 +191,10 @@
198191 }
199192 closed = true;
200193 }
201- cy += -this.operandStack.get(0);
194+ cy += -this.operandStack.get(this.operandStack.size() - 1);
202195 path.moveTo(cx, cy);
203196 if (DEBUG) {
204- System.err.println("moveTo " + cx + " " + cy);
197+ System.err.println("vmoveTo " + cx + " " + cy);
205198 }
206199 this.operandStack.writeTo(buff, op, 1);
207200 this.operandStack.clear();
@@ -216,7 +209,7 @@
216209 cy += -this.operandStack.get(i + 1);
217210 path.lineTo(cx, cy);
218211 if (DEBUG) {
219- System.err.println("[rlineto]lineTo " + cx + " " + cy);
212+ System.err.println("rlineto " + cx + " " + cy);
220213 }
221214 }
222215 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -236,7 +229,7 @@
236229 }
237230 path.lineTo(cx, cy);
238231 if (DEBUG) {
239- System.err.println("[hlineto]lineTo " + cx + " " + cy);
232+ System.err.println("hlineto " + cx + " " + cy);
240233 }
241234 }
242235 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -256,7 +249,7 @@
256249 }
257250 path.lineTo(cx, cy);
258251 if (DEBUG) {
259- System.err.println("[vlineto]lineTo " + cx + " " + cy);
252+ System.err.println("vlineto " + cx + " " + cy);
260253 }
261254 }
262255 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -278,7 +271,7 @@
278271 path.curveTo(x1, y1, x2, y2, x3, y3);
279272 if (DEBUG) {
280273 System.err.println(
281- "curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
274+ "rrcurveto " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
282275 }
283276 }
284277 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -306,7 +299,7 @@
306299 path.curveTo(x1, y1, x2, y2, x3, y3);
307300 if (DEBUG) {
308301 System.err.println(
309- "curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
302+ "hhcurveto " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
310303 }
311304 }
312305 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -346,7 +339,7 @@
346339 path.curveTo(x1, y1, x2, y2, x3, y3);
347340 if (DEBUG) {
348341 System.err.println(
349- "curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
342+ "hvcurveto " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
350343 }
351344 }
352345 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -367,7 +360,7 @@
367360 float y3 = cy += -this.operandStack.get(i + 5);
368361 path.curveTo(x1, y1, x2, y2, x3, y3);
369362 if (DEBUG) {
370- System.err.println("[rcurveline]curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " "
363+ System.err.println("rcurveline " + x1 + " " + y1 + " " + x2 + " " + y2 + " "
371364 + x3 + " " + y3);
372365 }
373366 }
@@ -375,7 +368,7 @@
375368 cy += -this.operandStack.get(this.operandStack.size() - 1);
376369 path.lineTo(cx, cy);
377370 if (DEBUG) {
378- System.err.println("[rcurveline]lineTo " + cx + " " + cy);
371+ System.err.println("rcurveline " + cx + " " + cy);
379372 }
380373 this.operandStack.writeTo(buff, op, this.operandStack.size());
381374 this.operandStack.clear();
@@ -392,7 +385,7 @@
392385 cy += -this.operandStack.get(i + 1);
393386 path.lineTo(cx, cy);
394387 if (DEBUG) {
395- System.err.println("[rlinecurve]lineTo " + cx + " " + cy);
388+ System.err.println("rlinecurve " + cx + " " + cy);
396389 }
397390 }
398391 float x1 = cx += this.operandStack.get(i);
@@ -404,7 +397,7 @@
404397 path.curveTo(x1, y1, x2, y2, x3, y3);
405398 if (DEBUG) {
406399 System.err.println(
407- "[rlinecurve]curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
400+ "rlinecurve " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
408401 }
409402 this.operandStack.writeTo(buff, op, this.operandStack.size());
410403 this.operandStack.clear();
@@ -443,7 +436,7 @@
443436 path.curveTo(x1, y1, x2, y2, x3, y3);
444437 if (DEBUG) {
445438 System.err.println(
446- "curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
439+ "vwcurveto " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
447440 }
448441 }
449442 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -471,7 +464,7 @@
471464 path.curveTo(x1, y1, x2, y2, x3, y3);
472465 if (DEBUG) {
473466 System.err.println(
474- "curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
467+ "vvcurveto " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
475468 }
476469 }
477470 this.operandStack.writeTo(buff, op, this.operandStack.size());
@@ -495,11 +488,11 @@
495488 float y6 = cy += -this.operandStack.get(i + 11);
496489 path.curveTo(x1, y1, x2, y2, x3, y3);
497490 if (DEBUG) {
498- System.err.println("curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
491+ System.err.println("flex " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
499492 }
500493 path.curveTo(x4, y4, x5, y5, x6, y6);
501494 if (DEBUG) {
502- System.err.println("curveTo " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
495+ System.err.println("flex " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
503496 }
504497 this.operandStack.writeTo(buff, op, this.operandStack.size());
505498 this.operandStack.clear();
@@ -522,11 +515,11 @@
522515 float y6 = cy;
523516 path.curveTo(x1, y1, x2, y2, x3, y3);
524517 if (DEBUG) {
525- System.err.println("curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
518+ System.err.println("hflex " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
526519 }
527520 path.curveTo(x4, y4, x5, y5, x6, y6);
528521 if (DEBUG) {
529- System.err.println("curveTo " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
522+ System.err.println("hflex " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
530523 }
531524 this.operandStack.writeTo(buff, op, this.operandStack.size());
532525 this.operandStack.clear();
@@ -549,11 +542,11 @@
549542 float y6 = cy;
550543 path.curveTo(x1, y1, x2, y2, x3, y3);
551544 if (DEBUG) {
552- System.err.println("curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
545+ System.err.println("hflex1 " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
553546 }
554547 path.curveTo(x4, y4, x5, y5, x6, y6);
555548 if (DEBUG) {
556- System.err.println("curveTo " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
549+ System.err.println("hflex1 " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
557550 }
558551 this.operandStack.writeTo(buff, op, this.operandStack.size());
559552 this.operandStack.clear();
@@ -576,11 +569,11 @@
576569 float y6 = cy += -this.operandStack.get(i + 11);
577570 path.curveTo(x1, y1, x2, y2, x3, y3);
578571 if (DEBUG) {
579- System.err.println("curveTo " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
572+ System.err.println("flex1 " + x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3);
580573 }
581574 path.curveTo(x4, y4, x5, y5, x6, y6);
582575 if (DEBUG) {
583- System.err.println("curveTo " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
576+ System.err.println("flex1 " + x4 + " " + y4 + " " + x5 + " " + y5 + " " + x6 + " " + y6);
584577 }
585578 this.operandStack.writeTo(buff, op, this.operandStack.size());
586579 this.operandStack.clear();
--- copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/util/BufferedRandomAccessFile.java (revision 1581)
+++ copper/trunk/sakae/zs-font/src/main/java/net/zamasoft/font/util/BufferedRandomAccessFile.java (revision 1582)
@@ -145,6 +145,14 @@
145145 * {@inheritDoc}
146146 */
147147 @Override
148+ public int read(byte b[]) throws IOException {
149+ return this.read(b, 0, b.length);
150+ }
151+
152+ /**
153+ * {@inheritDoc}
154+ */
155+ @Override
148156 public int read(byte b[], int off, int len) throws IOException
149157 {
150158 int leftover = bufend - bufpos;
Show on old repository browser