diff options
author | Sven Gothel <[email protected]> | 2014-04-01 16:31:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-04-01 16:31:05 +0200 |
commit | b935d5248aef79e2386a284b32f5888348a382d6 (patch) | |
tree | 6b661210ee531968fcf7d5c75ded4ed58bd3b0fc /src/jogl/classes/com/jogamp/graph/font | |
parent | 07d1c5a272e528d130daf37b9aa7077aac8d748e (diff) |
Bug 801: WIP 1/2 - Add color attribute; Switch Shader instead of branching in shader; Update attributes and uniforms manually, drop ShaderState;
- ShaderCode
- add int insertShaderSource(int shaderIdx, int position, Class<?> context, String path)
- insertShaderSource(..): pos==-1 -> append code
- VectorUtil
- add isVec3InTriangle3(..., float epsilon)
- add testSeg2SegIntersection(..., float epsilon)
- add testTri2SegIntersection(..., float epsilon)
- AffineTransform: Return result for chaining
- Font
- Add pixel precise 'getPointsBounds(final AffineTransform transform, CharSequence string, float pixelSize)'
- Rename getString*() -> getMetric*()
- OTGlyph: Release _points field, no more used
-
- Graph Triangulation
- Count additional vertices in: Triangulator, CDTriangulator2D
- OutlineShape:
- Allow skipping of 'transformOutlines2Quadratic', i.e. allow tagging
OutlineShape to be quadratic_nurbs via 'setIsQuadraticNurbs()'
- Clarify cleanup ot outlines in same method 'cleanupOutlines()'
- Count additional vertices ..
- Graph Shader:
- Start splitting and segmenting shader code for:
- pass1 / pass2
- features, i.e. sampleCont, color-channel, ..
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/font')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/font/Font.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java index ac7a904e7..811ab9d94 100644 --- a/src/jogl/classes/com/jogamp/graph/font/Font.java +++ b/src/jogl/classes/com/jogamp/graph/font/Font.java @@ -27,7 +27,10 @@ */ package com.jogamp.graph.font; +import jogamp.graph.geom.plane.AffineTransform; + import com.jogamp.graph.curve.OutlineShape; +import com.jogamp.graph.curve.opengl.TextRegionUtil.ShapeVisitor; import com.jogamp.opengl.math.geom.AABBox; /** @@ -155,9 +158,26 @@ public interface Font { public int getNumGlyphs(); public float getLineHeight(float pixelSize); - public float getStringWidth(CharSequence string, float pixelSize); - public float getStringHeight(CharSequence string, float pixelSize); - public AABBox getStringBounds(CharSequence string, float pixelSize); + public float getMetricWidth(CharSequence string, float pixelSize); + public float getMetricHeight(CharSequence string, float pixelSize); + /** + * Return the <i>layout</i> bounding box as computed by each glyph's metrics. + * The result is not pixel correct, bit reflects layout specific metrics. + * <p> + * See {@link #getPointsBounds(AffineTransform, CharSequence, float)} for pixel correct results. + * </p> + * @param string string text + * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size. + */ + public AABBox getMetricBounds(CharSequence string, float pixelSize); + + /** + * Return the bounding box by taking each glyph's point-based bounding box into account. + * @param transform optional given transform + * @param string string text + * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size. + */ + public AABBox getPointsBounds(final AffineTransform transform, CharSequence string, float pixelSize); public boolean isPrintableChar( char c ); |