(メッセージはありません)
@@ -0,0 +1,14 @@ | ||
1 | +package jp.cssj.homare.css.lang; | |
2 | + | |
3 | +import jp.cssj.sakae.gc.text.hyphenation.impl.BindingRule; | |
4 | + | |
5 | +public class BreakAllBindingRule implements BindingRule { | |
6 | + public boolean atomic(char c1, char c2) { | |
7 | + return false; | |
8 | + } | |
9 | + | |
10 | + public boolean canSeparate(char c1, char c2) { | |
11 | + return true; | |
12 | + } | |
13 | + | |
14 | +} |
@@ -0,0 +1,14 @@ | ||
1 | +package jp.cssj.homare.css.lang; | |
2 | + | |
3 | +import java.lang.Character.UnicodeBlock; | |
4 | + | |
5 | +import jp.cssj.sakae.gc.text.hyphenation.impl.JapaneseBindingRule; | |
6 | + | |
7 | +public class JapaneseKeepAllBindingRule extends JapaneseBindingRule { | |
8 | + public boolean atomic(char c1, char c2) { | |
9 | + if (this.isCJK(c1) && this.isCJK(c2) && UnicodeBlock.of(c1) != UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION) { | |
10 | + return true; | |
11 | + } | |
12 | + return super.atomic(c1, c2); | |
13 | + } | |
14 | +} |
@@ -1,7 +1,9 @@ | ||
1 | 1 | package jp.cssj.homare.css.lang; |
2 | 2 | |
3 | +import jp.cssj.homare.css.CSSStyle; | |
3 | 4 | import jp.cssj.homare.css.value.TextTransformValue; |
4 | 5 | import jp.cssj.homare.css.value.ValueListValue; |
6 | +import jp.cssj.sakae.gc.text.hyphenation.Hyphenation; | |
5 | 7 | |
6 | 8 | /** |
7 | 9 | * 各言語のための固有の機能です。 |
@@ -55,4 +57,11 @@ | ||
55 | 57 | * @param len |
56 | 58 | */ |
57 | 59 | public void transform(TextTransformValue transform, char[] ch, int off, int len); |
60 | + | |
61 | + /** | |
62 | + * ハイフネーションを返します。 | |
63 | + * @param style | |
64 | + * @return | |
65 | + */ | |
66 | + public Hyphenation getHyphenation(final CSSStyle style); | |
58 | 67 | } |
@@ -18,7 +18,6 @@ | ||
18 | 18 | import jp.cssj.homare.css.Declaration; |
19 | 19 | import jp.cssj.homare.css.StyleContext; |
20 | 20 | import jp.cssj.homare.css.html.HTMLStyle; |
21 | -import jp.cssj.homare.css.lang.CSSJBindingRule; | |
22 | 21 | import jp.cssj.homare.css.lang.LanguageProfile; |
23 | 22 | import jp.cssj.homare.css.lang.LanguageProfileBundle; |
24 | 23 | import jp.cssj.homare.css.util.BoxValueUtils; |
@@ -48,7 +47,6 @@ | ||
48 | 47 | import jp.cssj.homare.css.value.Value; |
49 | 48 | import jp.cssj.homare.css.value.ValueListValue; |
50 | 49 | import jp.cssj.homare.css.value.VisibilityValue; |
51 | -import jp.cssj.homare.css.value.ext.CSSJBreakRuleValue; | |
52 | 50 | import jp.cssj.homare.css.value.ext.CSSJDirectionModeValue; |
53 | 51 | import jp.cssj.homare.css.value.ext.CSSJFirstHeadingValue; |
54 | 52 | import jp.cssj.homare.css.value.ext.CSSJLastHeadingValue; |
@@ -151,11 +149,8 @@ | ||
151 | 149 | import jp.cssj.homare.impl.css.property.css3.TextStrokeWidth; |
152 | 150 | import jp.cssj.homare.impl.css.property.css3.Transform; |
153 | 151 | import jp.cssj.homare.impl.css.property.css3.TransformOrigin; |
154 | -import jp.cssj.homare.impl.css.property.css3.WordBreak; | |
155 | 152 | import jp.cssj.homare.impl.css.property.css3.WordWrap; |
156 | -import jp.cssj.homare.impl.css.property.ext.CSSJBreakCharacters; | |
157 | 153 | import jp.cssj.homare.impl.css.property.ext.CSSJDirectionMode; |
158 | -import jp.cssj.homare.impl.css.property.ext.CSSJNoBreakCharacters; | |
159 | 154 | import jp.cssj.homare.impl.css.property.ext.CSSJPageContent; |
160 | 155 | import jp.cssj.homare.impl.css.property.ext.CSSJPageContentClear; |
161 | 156 | import jp.cssj.homare.impl.css.property.ext.CSSJRegeneratable; |
@@ -244,9 +239,6 @@ | ||
244 | 239 | import jp.cssj.sakae.gc.GC; |
245 | 240 | import jp.cssj.sakae.gc.GraphicsException; |
246 | 241 | import jp.cssj.sakae.gc.image.Image; |
247 | -import jp.cssj.sakae.gc.text.hyphenation.Hyphenation; | |
248 | -import jp.cssj.sakae.gc.text.hyphenation.impl.DefaultHyphenation; | |
249 | -import jp.cssj.sakae.gc.text.hyphenation.impl.JapaneseBindingRule; | |
250 | 242 | |
251 | 243 | /** |
252 | 244 | * @author MIYABE Tatsuhiko |
@@ -299,8 +291,6 @@ | ||
299 | 291 | |
300 | 292 | private byte state = 0; |
301 | 293 | |
302 | - private final Hyphenation hyphenation; | |
303 | - | |
304 | 294 | public StyleBuilder(StyleContext styleContext, UserAgent ua, Imposition imposition) { |
305 | 295 | this.styleContext = styleContext; |
306 | 296 | this.ua = ua; |
@@ -307,7 +297,6 @@ | ||
307 | 297 | this.pageNumber = ua.getPassContext().getPageNumber(); |
308 | 298 | this.imposition = imposition; |
309 | 299 | this.doc = new DocumentBuilder(this); |
310 | - this.hyphenation = new DefaultHyphenation(new JapaneseBindingRule()); | |
311 | 300 | |
312 | 301 | byte pageMode = 0; |
313 | 302 | // 自動高さ |
@@ -419,18 +408,6 @@ | ||
419 | 408 | return this.pageElement; |
420 | 409 | } |
421 | 410 | |
422 | - private Hyphenation getHyphenation(final CSSStyle style) { | |
423 | - // 禁則処理 | |
424 | - final CSSJBreakRuleValue include = CSSJNoBreakCharacters.get(style); | |
425 | - final CSSJBreakRuleValue exclude = CSSJBreakCharacters.get(style); | |
426 | - if (include != CSSJBreakRuleValue.NONE_VALUE || exclude != CSSJBreakRuleValue.NONE_VALUE) { | |
427 | - final CSSJBindingRule binding = new CSSJBindingRule(include, exclude); | |
428 | - return new DefaultHyphenation(binding); | |
429 | - } | |
430 | - | |
431 | - return this.hyphenation; | |
432 | - } | |
433 | - | |
434 | 411 | /** |
435 | 412 | * 相対配置可能な配置の設定します。 |
436 | 413 | * |
@@ -569,10 +546,7 @@ | ||
569 | 546 | private void setupTextParams(AbstractTextParams params, CSSStyle style) { |
570 | 547 | this.setupParams(params, style); |
571 | 548 | params.whiteSpace = WhiteSpace.get(style); |
572 | - params.wordWrap = WordBreak.get(style); | |
573 | - if (params.wordWrap == AbstractTextParams.WORD_WRAP_NORMAL) { | |
574 | - params.wordWrap = WordWrap.get(style); | |
575 | - } | |
549 | + params.wordWrap = WordWrap.get(style); | |
576 | 550 | params.color = TextFillColor.get(style); |
577 | 551 | params.decoration = TextDecoration.get(style); |
578 | 552 | params.decorationThickness = 1.0 / style.getUserAgent().getFontSize(UserAgent.FONT_SIZE_MEDIUM) / 2.0; |
@@ -584,7 +558,9 @@ | ||
584 | 558 | params.textTransform = TextTransform.get(style); |
585 | 559 | params.fontStyle = style.getFontStyle(); |
586 | 560 | params.fontManager = this.ua.getFontManager(); |
587 | - params.hyphenation = this.getHyphenation(style); | |
561 | + final LanguageProfile lang = LanguageProfileBundle | |
562 | + .getLanguageProfile(style.getCSSElement().lang); | |
563 | + params.hyphenation = lang.getHyphenation(style); | |
588 | 564 | params.direction = Direction.get(style); |
589 | 565 | params.flow = BlockFlow.get(style); |
590 | 566 | } |
@@ -1147,6 +1123,9 @@ | ||
1147 | 1123 | this.toPageContentClear.put(ce, pageContentClearNames); |
1148 | 1124 | } |
1149 | 1125 | |
1126 | + final LanguageProfile lang = LanguageProfileBundle | |
1127 | + .getLanguageProfile(style.getCSSElement().lang); | |
1128 | + | |
1150 | 1129 | if (pageContentName != null) { |
1151 | 1130 | final PageContent pageContent; |
1152 | 1131 | if (regenerate) { |
@@ -1163,7 +1142,7 @@ | ||
1163 | 1142 | params.element = ce; |
1164 | 1143 | params.fontStyle = style.getFontStyle(); |
1165 | 1144 | params.fontManager = this.ua.getFontManager(); |
1166 | - params.hyphenation = this.getHyphenation(style); | |
1145 | + params.hyphenation = lang.getHyphenation(style); | |
1167 | 1146 | final InlineBox inlineBox = new InlineBox(params, pos); |
1168 | 1147 | this.doc.startBox(inlineBox); |
1169 | 1148 | this.doc.endBox(); |
@@ -1273,7 +1252,7 @@ | ||
1273 | 1252 | BlockParams params = new BlockParams(); |
1274 | 1253 | params.fontStyle = style.getFontStyle(); |
1275 | 1254 | params.fontManager = this.ua.getFontManager(); |
1276 | - params.hyphenation = this.getHyphenation(style); | |
1255 | + params.hyphenation = lang.getHyphenation(style); | |
1277 | 1256 | params.direction = Direction.get(style); |
1278 | 1257 | params.flow = BlockFlow.get(style); |
1279 | 1258 | params.element = ce; |
@@ -2669,7 +2648,9 @@ | ||
2669 | 2648 | params.flow = this.progression; |
2670 | 2649 | params.fontStyle = pageStyle.getFontStyle(); |
2671 | 2650 | params.fontManager = this.ua.getFontManager(); |
2672 | - params.hyphenation = this.getHyphenation(pageStyle); | |
2651 | + final LanguageProfile lang = LanguageProfileBundle | |
2652 | + .getLanguageProfile(pageStyle.getCSSElement().lang); | |
2653 | + params.hyphenation = lang.getHyphenation(pageStyle); | |
2673 | 2654 | |
2674 | 2655 | // ページのサイズ |
2675 | 2656 | double width = this.imposition.getPageWidth(); |
@@ -165,9 +165,6 @@ | ||
165 | 165 | // |
166 | 166 | public static final short TYPE_UNICODE_BIDI = TYPE_DIRECTION + 1; |
167 | 167 | |
168 | - // 単語の分割 | |
169 | - public static final short TYPE_WORD_WRAP = TYPE_UNICODE_BIDI + 1; | |
170 | - | |
171 | 168 | /** |
172 | 169 | * 値のタイプを返します。 |
173 | 170 | * |
@@ -23,5 +23,8 @@ | ||
23 | 23 | |
24 | 24 | public static final short TYPE_BOX_SIZING = 3010; |
25 | 25 | |
26 | - public static final short TYPE_WORD_BREAK = 3011; | |
26 | + // 単語の分割 | |
27 | + public static final short TYPE_WORD_WRAP = 3011; | |
28 | + | |
29 | + public static final short TYPE_WORD_BREAK = 3012; | |
27 | 30 | } |
\ No newline at end of file |
@@ -1,16 +1,22 @@ | ||
1 | 1 | package jp.cssj.homare.css.value.css3; |
2 | 2 | |
3 | -import jp.cssj.homare.style.box.params.AbstractTextParams; | |
4 | - | |
5 | 3 | /** |
6 | 4 | * @author MIYABE Tatsuhiko |
7 | 5 | * @version $Id: WordWrapValue.java 1552 2018-04-26 01:43:24Z miyabe $ |
8 | 6 | */ |
9 | 7 | public class WordBreakValue implements CSS3Value { |
10 | - public static final WordBreakValue NORMAL_VALUE = new WordBreakValue(AbstractTextParams.WORD_WRAP_NORMAL); | |
8 | + public static final byte NORMAL = 1; | |
11 | 9 | |
12 | - public static final WordBreakValue BREAK_ALL_VALUE = new WordBreakValue(AbstractTextParams.WORD_WRAP_BREAK_ALL); | |
10 | + public static final byte BREAK_ALL = 2; | |
13 | 11 | |
12 | + public static final byte KEEP_ALL = 3; | |
13 | + | |
14 | + public static final WordBreakValue NORMAL_VALUE = new WordBreakValue(NORMAL); | |
15 | + | |
16 | + public static final WordBreakValue BREAK_ALL_VALUE = new WordBreakValue(BREAK_ALL); | |
17 | + | |
18 | + public static final WordBreakValue KEEP_ALL_VALUE = new WordBreakValue(KEEP_ALL); | |
19 | + | |
14 | 20 | private final byte wordBreak; |
15 | 21 | |
16 | 22 | private WordBreakValue(byte wordBreak) { |
@@ -27,12 +33,15 @@ | ||
27 | 33 | |
28 | 34 | public String toString() { |
29 | 35 | switch (this.wordBreak) { |
30 | - case AbstractTextParams.WORD_WRAP_NORMAL: | |
36 | + case NORMAL: | |
31 | 37 | return "normal"; |
32 | 38 | |
33 | - case AbstractTextParams.WORD_WRAP_BREAK_ALL: | |
39 | + case BREAK_ALL: | |
34 | 40 | return "break-all"; |
35 | 41 | |
42 | + case KEEP_ALL: | |
43 | + return "keep-all"; | |
44 | + | |
36 | 45 | default: |
37 | 46 | throw new IllegalStateException(); |
38 | 47 | } |
@@ -0,0 +1,40 @@ | ||
1 | +package jp.cssj.homare.css.value.css3; | |
2 | + | |
3 | +import jp.cssj.homare.style.box.params.AbstractTextParams; | |
4 | + | |
5 | +/** | |
6 | + * @author MIYABE Tatsuhiko | |
7 | + * @version $Id: WordWrapValue.java 1552 2018-04-26 01:43:24Z miyabe $ | |
8 | + */ | |
9 | +public class WordWrapValue implements CSS3Value { | |
10 | + public static final WordWrapValue NORMAL_VALUE = new WordWrapValue(AbstractTextParams.WORD_WRAP_NORMAL); | |
11 | + | |
12 | + public static final WordWrapValue BREAK_WORD_VALUE = new WordWrapValue(AbstractTextParams.WORD_WRAP_BREAK_WORD); | |
13 | + | |
14 | + private final byte wordWrap; | |
15 | + | |
16 | + private WordWrapValue(byte wordWrap) { | |
17 | + this.wordWrap = wordWrap; | |
18 | + } | |
19 | + | |
20 | + public short getValueType() { | |
21 | + return TYPE_WORD_WRAP; | |
22 | + } | |
23 | + | |
24 | + public byte getWordWrap() { | |
25 | + return this.wordWrap; | |
26 | + } | |
27 | + | |
28 | + public String toString() { | |
29 | + switch (this.wordWrap) { | |
30 | + case AbstractTextParams.WORD_WRAP_NORMAL: | |
31 | + return "normal"; | |
32 | + | |
33 | + case AbstractTextParams.WORD_WRAP_BREAK_WORD: | |
34 | + return "break-word"; | |
35 | + | |
36 | + default: | |
37 | + throw new IllegalStateException(); | |
38 | + } | |
39 | + } | |
40 | +} | |
\ No newline at end of file |
@@ -1,11 +1,23 @@ | ||
1 | 1 | package jp.cssj.homare.impl.css.lang; |
2 | 2 | |
3 | +import jp.cssj.homare.css.CSSStyle; | |
4 | +import jp.cssj.homare.css.lang.BreakAllBindingRule; | |
5 | +import jp.cssj.homare.css.lang.CSSJBindingRule; | |
6 | +import jp.cssj.homare.css.lang.JapaneseKeepAllBindingRule; | |
3 | 7 | import jp.cssj.homare.css.lang.LanguageProfile; |
4 | 8 | import jp.cssj.homare.css.value.QuotesValue; |
5 | 9 | import jp.cssj.homare.css.value.TextTransformValue; |
6 | 10 | import jp.cssj.homare.css.value.Value; |
7 | 11 | import jp.cssj.homare.css.value.ValueListValue; |
12 | +import jp.cssj.homare.css.value.css3.WordBreakValue; | |
13 | +import jp.cssj.homare.css.value.ext.CSSJBreakRuleValue; | |
14 | +import jp.cssj.homare.impl.css.property.css3.WordBreak; | |
15 | +import jp.cssj.homare.impl.css.property.ext.CSSJBreakCharacters; | |
16 | +import jp.cssj.homare.impl.css.property.ext.CSSJNoBreakCharacters; | |
8 | 17 | import jp.cssj.homare.style.box.params.AbstractTextParams; |
18 | +import jp.cssj.sakae.gc.text.hyphenation.Hyphenation; | |
19 | +import jp.cssj.sakae.gc.text.hyphenation.impl.DefaultHyphenation; | |
20 | +import jp.cssj.sakae.gc.text.hyphenation.impl.JapaneseBindingRule; | |
9 | 21 | |
10 | 22 | /** |
11 | 23 | * @author MIYABE Tatsuhiko |
@@ -14,6 +26,12 @@ | ||
14 | 26 | public class LanguageProfile_ja implements LanguageProfile { |
15 | 27 | private static final ValueListValue QUOTES = new ValueListValue( |
16 | 28 | new Value[] { new QuotesValue("「", "」"), new QuotesValue("『", "』"), }); |
29 | + | |
30 | + private final Hyphenation normalHyph = new DefaultHyphenation(new JapaneseBindingRule()); | |
31 | + | |
32 | + private final Hyphenation breakAllHyph = new DefaultHyphenation(new BreakAllBindingRule()); | |
33 | + | |
34 | + private final Hyphenation keepAllHyph = new DefaultHyphenation(new JapaneseKeepAllBindingRule()); | |
17 | 35 | |
18 | 36 | public String getLanguage() { |
19 | 37 | return "ja"; |
@@ -128,4 +146,28 @@ | ||
128 | 146 | throw new IllegalStateException(); |
129 | 147 | } |
130 | 148 | } |
149 | + | |
150 | + public Hyphenation getHyphenation(final CSSStyle style) { | |
151 | + // 禁則処理 | |
152 | + switch(WordBreak.get(style)) { | |
153 | + case WordBreakValue.NORMAL: | |
154 | + final CSSJBreakRuleValue include = CSSJNoBreakCharacters.get(style); | |
155 | + final CSSJBreakRuleValue exclude = CSSJBreakCharacters.get(style); | |
156 | + if (include != CSSJBreakRuleValue.NONE_VALUE || exclude != CSSJBreakRuleValue.NONE_VALUE) { | |
157 | + final CSSJBindingRule binding = new CSSJBindingRule(include, exclude); | |
158 | + return new DefaultHyphenation(binding); | |
159 | + } | |
160 | + | |
161 | + return this.normalHyph; | |
162 | + | |
163 | + case WordBreakValue.KEEP_ALL: | |
164 | + return this.keepAllHyph; | |
165 | + | |
166 | + case WordBreakValue.BREAK_ALL: | |
167 | + return this.breakAllHyph; | |
168 | + default: | |
169 | + throw new IllegalStateException(); | |
170 | + } | |
171 | + | |
172 | + } | |
131 | 173 | } |
\ No newline at end of file |
@@ -42,10 +42,12 @@ | ||
42 | 42 | switch (lu.getLexicalUnitType()) { |
43 | 43 | case LexicalUnit.SAC_IDENT: |
44 | 44 | String ident = lu.getStringValue().toLowerCase(); |
45 | - if (ident.equals("normal") || ident.equals("keep-all")) { | |
45 | + if (ident.equals("normal")) { | |
46 | 46 | return WordBreakValue.NORMAL_VALUE; |
47 | 47 | } else if (ident.equals("break-all")) { |
48 | 48 | return WordBreakValue.BREAK_ALL_VALUE; |
49 | + } else if (ident.equals("keep-all")) { | |
50 | + return WordBreakValue.KEEP_ALL_VALUE; | |
49 | 51 | } |
50 | 52 | |
51 | 53 | default: |
@@ -7,7 +7,7 @@ | ||
7 | 7 | import jp.cssj.homare.css.property.PrimitivePropertyInfo; |
8 | 8 | import jp.cssj.homare.css.property.PropertyException; |
9 | 9 | import jp.cssj.homare.css.value.Value; |
10 | -import jp.cssj.homare.css.value.WordWrapValue; | |
10 | +import jp.cssj.homare.css.value.css3.WordWrapValue; | |
11 | 11 | import jp.cssj.homare.ua.UserAgent; |
12 | 12 | import jp.cssj.sakae.sac.css.LexicalUnit; |
13 | 13 |
@@ -17,7 +17,6 @@ | ||
17 | 17 | import org.apache.batik.anim.dom.SVGOMSVGElement; |
18 | 18 | import org.apache.batik.bridge.BridgeContext; |
19 | 19 | import org.apache.batik.bridge.BridgeException; |
20 | -import org.apache.batik.bridge.DocumentLoader; | |
21 | 20 | import org.apache.batik.bridge.GVTBuilder; |
22 | 21 | import org.apache.batik.gvt.GraphicsNode; |
23 | 22 | import org.apache.batik.util.ParsedURL; |
@@ -33,7 +32,6 @@ | ||
33 | 32 | import jp.cssj.sakae.svg.Dimension2DImpl; |
34 | 33 | import jp.cssj.sakae.svg.GVTBuilderImpl; |
35 | 34 | import jp.cssj.sakae.svg.SVGImage; |
36 | -import jp.cssj.sakae.svg.UserAgentImpl; | |
37 | 35 | |
38 | 36 | public class SVGImageLoader implements ImageLoader { |
39 | 37 | private static final Logger LOG = Logger.getLogger(SVGImageLoader.class.getName()); |
@@ -136,9 +134,7 @@ | ||
136 | 134 | } catch (Exception e) { |
137 | 135 | // ignore |
138 | 136 | } |
139 | - UserAgentImpl uax = new UserAgentImpl(viewport); | |
140 | - DocumentLoader loader = new DocumentLoader(uax); | |
141 | - BridgeContext ctx = new BridgeContext(uax, loader); | |
137 | + BridgeContext ctx = new BridgeContextImpl(docURI, ua, viewport, this); | |
142 | 138 | GVTBuilder gvt = new GVTBuilderImpl(); |
143 | 139 | GraphicsNode gvtRoot = gvt.build(ctx, doc); |
144 | 140 |
@@ -38,8 +38,6 @@ | ||
38 | 38 | public static final byte WORD_WRAP_NORMAL = 1; |
39 | 39 | |
40 | 40 | public static final byte WORD_WRAP_BREAK_WORD = 2; |
41 | - | |
42 | - public static final byte WORD_WRAP_BREAK_ALL = 3; | |
43 | 41 | |
44 | 42 | public static final byte DECORATION_UNDERLINE = 0x01; |
45 | 43 |
@@ -853,25 +853,21 @@ | ||
853 | 853 | // } |
854 | 854 | // this.flush(); |
855 | 855 | // } |
856 | - if (this.breakWord != AbstractTextParams.WORD_WRAP_NORMAL && this.unitAdvance > 0) { | |
856 | + if (this.breakWord == AbstractTextParams.WORD_WRAP_BREAK_WORD && this.unitAdvance > 0) { | |
857 | 857 | if (this.firstUnit) { |
858 | 858 | this.locateLine(); |
859 | 859 | this.firstUnit = false; |
860 | 860 | } |
861 | - if (this.breakWord == AbstractTextParams.WORD_WRAP_BREAK_ALL) { | |
862 | - this.flush(); | |
861 | + double lineAxis = this.unitAdvance + this.letterSpacing; | |
862 | + if (this.text == null) { | |
863 | + lineAxis += this.fontMetrics.getAdvance(gid); | |
863 | 864 | } else { |
864 | - double lineAxis = this.unitAdvance + this.letterSpacing; | |
865 | - if (this.text == null) { | |
866 | - lineAxis += this.fontMetrics.getAdvance(gid); | |
867 | - } else { | |
868 | - lineAxis += this.text.glyphAdvance(gid); | |
869 | - } | |
870 | - final double maxLineAxis = this.maxLineSize - this.textIndent; | |
871 | - if (StyleUtils.compare(lineAxis, maxLineAxis) > 0) { | |
872 | - this.flush(); | |
873 | - } | |
865 | + lineAxis += this.text.glyphAdvance(gid); | |
874 | 866 | } |
867 | + final double maxLineAxis = this.maxLineSize - this.textIndent; | |
868 | + if (StyleUtils.compare(lineAxis, maxLineAxis) > 0) { | |
869 | + this.flush(); | |
870 | + } | |
875 | 871 | } |
876 | 872 | |
877 | 873 | if (this.text == null) { |
@@ -108,7 +108,7 @@ | ||
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | |
111 | - private boolean isCJK(char c) { | |
111 | + protected boolean isCJK(char c) { | |
112 | 112 | UnicodeBlock b = UnicodeBlock.of(c); |
113 | 113 | if (b == null) { |
114 | 114 | return true; |