diff options
14 files changed, 74 insertions, 30 deletions
diff --git a/src/com/jogamp/graph/curve/text/HwTextRenderer.java b/src/com/jogamp/graph/curve/text/HwTextRenderer.java index 5813225e4..61d8309c7 100644 --- a/src/com/jogamp/graph/curve/text/HwTextRenderer.java +++ b/src/com/jogamp/graph/curve/text/HwTextRenderer.java @@ -39,14 +39,15 @@ import javax.media.opengl.GLUniformData; import javax.media.opengl.fixedfunc.GLMatrixFunc; import jogamp.graph.curve.text.GlyphString; +import jogamp.graph.font.FontInt; import jogamp.graph.font.typecast.TypecastFontFactory; +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.graph.curve.Region; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontFactory; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; import com.jogamp.graph.geom.Point; import com.jogamp.graph.geom.PointTex; import com.jogamp.graph.geom.opengl.Vertex; @@ -299,7 +300,7 @@ public class HwTextRenderer { AffineTransform affineTransform = new AffineTransform(pointFactory); Path2D[] paths = new Path2D[str.length()]; - font.getOutline(str, affineTransform, paths); + ((FontInt)font).getOutline(str, affineTransform, paths); GlyphString glyphString = new GlyphString(pointFactory, font.getName(), str); glyphString.createfromFontPath(paths, affineTransform); diff --git a/src/com/jogamp/graph/font/Font.java b/src/com/jogamp/graph/font/Font.java index 5c26e8626..0abaad5b5 100644 --- a/src/com/jogamp/graph/font/Font.java +++ b/src/com/jogamp/graph/font/Font.java @@ -28,8 +28,6 @@ package com.jogamp.graph.font; import com.jogamp.graph.geom.AABBox; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; public interface Font { @@ -60,8 +58,6 @@ public interface Font { public AABBox getBBox(); public float getAdvance(); public float getAdvanceForPixelSize(float pixelSize, boolean useFrationalMetrics); - public Path2D getPath(); - public Path2D getPathForPixelSize(float pixelSize); } @@ -74,9 +70,5 @@ public interface Font { public float getStringHeight(String string); public AABBox getStringBounds(CharSequence string); - public void getOutline(String string, - AffineTransform transform, - Path2D[] result); - public int getNumGlyphs(); }
\ No newline at end of file diff --git a/src/jogamp/graph/curve/text/GlyphShape.java b/src/jogamp/graph/curve/text/GlyphShape.java index 9862a5407..8e16de1a4 100644 --- a/src/jogamp/graph/curve/text/GlyphShape.java +++ b/src/jogamp/graph/curve/text/GlyphShape.java @@ -29,7 +29,8 @@ package jogamp.graph.curve.text; import java.util.ArrayList; -import com.jogamp.graph.geom.plane.PathIterator; +import jogamp.graph.geom.plane.PathIterator; + import com.jogamp.graph.geom.Line; import com.jogamp.graph.geom.Point; import com.jogamp.graph.geom.PointTex; diff --git a/src/jogamp/graph/curve/text/GlyphString.java b/src/jogamp/graph/curve/text/GlyphString.java index d85e59c43..75d7e4402 100644 --- a/src/jogamp/graph/curve/text/GlyphString.java +++ b/src/jogamp/graph/curve/text/GlyphString.java @@ -29,9 +29,6 @@ package jogamp.graph.curve.text; import java.util.ArrayList; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; -import com.jogamp.graph.geom.plane.PathIterator; import com.jogamp.graph.geom.Point; import com.jogamp.graph.geom.PointTex; import com.jogamp.graph.geom.Triangle; @@ -39,6 +36,10 @@ import com.jogamp.graph.geom.opengl.Vertex; import javax.media.opengl.GLContext; +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; +import jogamp.graph.geom.plane.PathIterator; + import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.RegionFactory; diff --git a/src/jogamp/graph/font/FontInt.java b/src/jogamp/graph/font/FontInt.java new file mode 100644 index 000000000..5b938bdbf --- /dev/null +++ b/src/jogamp/graph/font/FontInt.java @@ -0,0 +1,45 @@ +/** + * Copyright 2011 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package jogamp.graph.font; + +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; + +import com.jogamp.graph.font.Font; + +public interface FontInt extends Font { + + public interface Glyph extends Font.Glyph { + public Path2D getPath(); + public Path2D getPathForPixelSize(float pixelSize); + } + + public void getOutline(String string, + AffineTransform transform, + Path2D[] result); +} diff --git a/src/jogamp/graph/font/typecast/TypecastFont.java b/src/jogamp/graph/font/typecast/TypecastFont.java index 7cc80cc13..d054635e4 100644 --- a/src/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogamp/graph/font/typecast/TypecastFont.java @@ -30,7 +30,10 @@ package jogamp.graph.font.typecast; import java.io.File; import java.io.IOException; +import jogamp.graph.font.FontInt; import jogamp.graph.font.JavaFontLoader; +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; import net.java.dev.typecast.ot.OTFont; import net.java.dev.typecast.ot.OTFontCollection; @@ -41,12 +44,10 @@ import net.java.dev.typecast.ot.table.ID; import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.graph.font.Font; import com.jogamp.graph.geom.AABBox; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; import com.jogamp.graph.geom.PointTex; import com.jogamp.graph.geom.Point; -class TypecastFont implements Font { +class TypecastFont implements FontInt { static final boolean DEBUG = false; final Point.Factory<? extends PointTex> pointFactory; diff --git a/src/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogamp/graph/font/typecast/TypecastGlyph.java index faca8c779..9bb582974 100644 --- a/src/jogamp/graph/font/typecast/TypecastGlyph.java +++ b/src/jogamp/graph/font/typecast/TypecastGlyph.java @@ -27,12 +27,14 @@ */ package jogamp.graph.font.typecast; +import jogamp.graph.font.FontInt; +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; + import com.jogamp.graph.font.Font; import com.jogamp.graph.geom.AABBox; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; -public class TypecastGlyph implements Font.Glyph { +public class TypecastGlyph implements FontInt.Glyph { public class Advance { Font font; diff --git a/src/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogamp/graph/font/typecast/TypecastRenderer.java index 7b36d22b5..3813eb474 100644 --- a/src/jogamp/graph/font/typecast/TypecastRenderer.java +++ b/src/jogamp/graph/font/typecast/TypecastRenderer.java @@ -27,9 +27,10 @@ */ package jogamp.graph.font.typecast; +import jogamp.graph.geom.plane.AffineTransform; +import jogamp.graph.geom.plane.Path2D; + import com.jogamp.graph.font.Font; -import com.jogamp.graph.geom.plane.AffineTransform; -import com.jogamp.graph.geom.plane.Path2D; import com.jogamp.graph.geom.PointTex; import com.jogamp.graph.geom.Point.Factory; diff --git a/src/com/jogamp/graph/geom/plane/AffineTransform.java b/src/jogamp/graph/geom/plane/AffineTransform.java index 321551edc..02fb9993d 100644 --- a/src/com/jogamp/graph/geom/plane/AffineTransform.java +++ b/src/jogamp/graph/geom/plane/AffineTransform.java @@ -17,7 +17,7 @@ /** * @author Denis M. Kishenko */ -package com.jogamp.graph.geom.plane; +package jogamp.graph.geom.plane; import java.io.IOException; import java.io.Serializable; diff --git a/src/com/jogamp/graph/geom/plane/IllegalPathStateException.java b/src/jogamp/graph/geom/plane/IllegalPathStateException.java index 15f629b88..55211b3f9 100644 --- a/src/com/jogamp/graph/geom/plane/IllegalPathStateException.java +++ b/src/jogamp/graph/geom/plane/IllegalPathStateException.java @@ -17,7 +17,7 @@ /** * @author Denis M. Kishenko */ -package com.jogamp.graph.geom.plane; +package jogamp.graph.geom.plane; public class IllegalPathStateException extends RuntimeException { diff --git a/src/com/jogamp/graph/geom/plane/NoninvertibleTransformException.java b/src/jogamp/graph/geom/plane/NoninvertibleTransformException.java index cd1ec8d16..398a03fca 100644 --- a/src/com/jogamp/graph/geom/plane/NoninvertibleTransformException.java +++ b/src/jogamp/graph/geom/plane/NoninvertibleTransformException.java @@ -17,7 +17,7 @@ /** * @author Denis M. Kishenko */ -package com.jogamp.graph.geom.plane; +package jogamp.graph.geom.plane; public class NoninvertibleTransformException extends java.lang.Exception { diff --git a/src/com/jogamp/graph/geom/plane/Path2D.java b/src/jogamp/graph/geom/plane/Path2D.java index 031450c8e..cfb966ac4 100644 --- a/src/com/jogamp/graph/geom/plane/Path2D.java +++ b/src/jogamp/graph/geom/plane/Path2D.java @@ -17,7 +17,7 @@ /** * @author Denis M. Kishenko */ -package com.jogamp.graph.geom.plane; +package jogamp.graph.geom.plane; import java.util.NoSuchElementException; diff --git a/src/com/jogamp/graph/geom/plane/PathIterator.java b/src/jogamp/graph/geom/plane/PathIterator.java index b4681df0a..8868a8c58 100644 --- a/src/com/jogamp/graph/geom/plane/PathIterator.java +++ b/src/jogamp/graph/geom/plane/PathIterator.java @@ -17,7 +17,7 @@ /** * @author Denis M. Kishenko */ -package com.jogamp.graph.geom.plane; +package jogamp.graph.geom.plane; public interface PathIterator { diff --git a/src/jogamp/graph/math/plane/Crossing.java b/src/jogamp/graph/math/plane/Crossing.java index 5620da73a..8f8638632 100644 --- a/src/jogamp/graph/math/plane/Crossing.java +++ b/src/jogamp/graph/math/plane/Crossing.java @@ -19,10 +19,10 @@ */ package jogamp.graph.math.plane; +import jogamp.graph.geom.plane.Path2D; +import jogamp.graph.geom.plane.PathIterator; import jogamp.graph.math.MathFloat; -import com.jogamp.graph.geom.plane.Path2D; -import com.jogamp.graph.geom.plane.PathIterator; public class Crossing { |