diff options
author | Roman Kennke <roman@kennke.org> | 2006-12-16 20:51:01 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2006-12-16 20:51:01 +0000 |
commit | 7061738ae0359a82559bc19e7c8f9316fa0721c1 (patch) | |
tree | bce986a33e4ccf7c9ce7e114b9e06937dae8a15f /gnu/java/awt/font/autofit/Latin.java | |
parent | 1ffd40e6b6dc7495403327511d5df94b69c7acab (diff) | |
download | classpath-7061738ae0359a82559bc19e7c8f9316fa0721c1.tar.gz |
2006-12-16 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/font/FontDelegate.java
(FLAG_FITTED): New constant field.
(FLAG_NO_HINT_HORIZONTAL): New constant field.
(FLAG_NO_HINT_VERTICAL): New constant field.w
(FLAG_NO_HINT_EDGE_POINTS): New constant field.
(FLAG_NO_HINT_STRONG_POINTS): New constant field.
(FLAG_NO_HINT_WEAK_POINTS): New constant field.
(TYPE_FITTED): Replaced by flags above.
(TYPE_SCALED): Replaced by flags above.
(TYPE_ORIGINAL): Replaced by flags above.
* gnu/java/awt/font/GNUGlyphVector.java
(getGlyphOutline): Use FLAG_FITTED.
* gnu/java/awt/font/autofit/AutoHinter.java
(setFlags): New method. Sets hinting flags.
* gnu/java/awt/font/autofit/GlyphHints.java
(flags): New field.
(alignStrongPoint): Use 16.16 fixed arithmetic.
(doAlignEdgePoints): New helper method.
(doAlignStrongPoints): New helper method.
(doAlignWeakPoints): New helper method.
(doHorizonal): Check flags.
(doVertical): Check flags.
* gnu/java/awt/font/autofit/Latin.java
(applyHints): Check hinting flags.
(computeEdges): Also initialize fitted position.
(scaleMetricsDim): Commented out buggy block.
* gnu/java/awt/font/opentype/Hinter.java
(setFlags): New method.
* gnu/java/awt/font/opentype/OpenTypeFont.java
(checkHinter): Accept flags parameter.
(createGlyphVector): Pass flags to hinter.
(getGlyphOutline): Pass flags to hinter.
* gnu/java/awt/font/opentype/truetype/Fixed.java
(floatValue16): New method.
* gnu/java/awt/font/opentype/truetype/Zone.java
(getX): Use new flags.
(getY): Use new flags.
Diffstat (limited to 'gnu/java/awt/font/autofit/Latin.java')
-rw-r--r-- | gnu/java/awt/font/autofit/Latin.java | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/gnu/java/awt/font/autofit/Latin.java b/gnu/java/awt/font/autofit/Latin.java index db2d369d7..8951e8b19 100644 --- a/gnu/java/awt/font/autofit/Latin.java +++ b/gnu/java/awt/font/autofit/Latin.java @@ -97,9 +97,12 @@ class Latin || dim == DIMENSION_VERT && hints.doVertical()) { hintEdges(hints, dim); - hints.alignEdgePoints(dim); - hints.alignStrongPoints(dim); - hints.alignWeakPoints(dim); + if (hints.doAlignEdgePoints()) + hints.alignEdgePoints(dim); + if (hints.doAlignStrongPoints()) + hints.alignStrongPoints(dim); + if (hints.doAlignWeakPoints()) + hints.alignWeakPoints(dim); } } @@ -283,7 +286,9 @@ class Latin edge2.flags |= Segment.FLAG_EDGE_DONE; if (e > 0 && edge.pos < edges[e - 1].pos) - edge.pos = edges[e - 1].pos; + { + edge.pos = edges[e - 1].pos; + } } } // TODO: Implement the lowercase m symmetry thing. @@ -595,33 +600,33 @@ class Latin // letters to the pixel grid. LatinAxis axis2 = lm.axis[DIMENSION_VERT]; LatinBlue blue = null; - for (int nn = 0; nn < axis2.blueCount; nn++) - { - if ((axis2.blues[nn].flags & LatinBlue.FLAG_ADJUSTMENT) != 0) - { - blue = axis2.blues[nn]; - break; - } - } - if (blue != null) - { - int scaled = Fixed.mul16(blue.shoot.org, scaler.yScale); - int fitted = Utils.pixRound(scaled); - if (scaled != fitted) - { - if (dim == DIMENSION_HORZ) - { - if (fitted < scaled) - { - scale -= scale / 50; - } - } - else - { - scale = Utils.mulDiv(scale, fitted, scaled); - } - } - } +// for (int nn = 0; nn < axis2.blueCount; nn++) +// { +// if ((axis2.blues[nn].flags & LatinBlue.FLAG_ADJUSTMENT) != 0) +// { +// blue = axis2.blues[nn]; +// break; +// } +// } +// if (blue != null) +// { +// int scaled = Fixed.mul16(blue.shoot.org, scaler.yScale); +// int fitted = Utils.pixRound(scaled); +// if (scaled != fitted) +// { +// if (dim == DIMENSION_HORZ) +// { +// if (fitted < scaled) +// { +// scale -= scale / 50; +// } +// } +// else +// { +// scale = Utils.mulDiv(scale, fitted, scaled); +// } +// } +// } axis.scale = scale; axis.delta = delta; if (dim == DIMENSION_HORZ) @@ -669,7 +674,7 @@ class Latin if (delta1 < 0) delta2 = -delta2; blue.ref.fit = Utils.pixRound(blue.ref.cur); - blue.shoot.fit = blue.ref.fit+ delta2; + blue.shoot.fit = blue.ref.fit + delta2; blue.flags |= LatinBlue.FLAG_BLUE_ACTIVE; } } @@ -1163,7 +1168,7 @@ class Latin edge.first = seg; edge.last = seg; edge.fpos = seg.pos; - edge.opos = Fixed.mul16(seg.pos, scale); + edge.opos = edge.pos = Fixed.mul16(seg.pos, scale); seg.edgeNext = seg; seg.edge = edge; } |