aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/font
Commit message (Collapse)AuthorAgeFilesLines
* Math: Complete Matrix4f w/ Vec[234]f and adopt it throughout Quaternion, ↵Sven Gothel2023-04-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ray, AABBox, Frustum, Stereo*, ... adding hook to PMVMatrix Motivation was to simplify matrix + vector math usage, ease review and avoid usage bugs. Matrix4f implementation uses dedicated float fields instead of an array. Performance didn't increase much, as JVM >= 11(?) has some optimizations to drop the array bounds check. AMD64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~3% slower than FloatUtil.multMatrix(a, b, dest) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~3% slower than FloatUtil.invertMatrix(..) RaspberryPi 4b aarch64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~20% slower than FloatUtil.multMatrix(a, b) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~4% slower than FloatUtil.invertMatrix(..) Conclusion - Matrix4f.mul(b) needs to be revised (esp for aarch64) - Matrix4f.invert(..) should also not be slower ..
* Graph Font.GlyphVisitor*: Pass 'char symbol' to visitor, passing full ↵Sven Gothel2023-03-281-2/+4
| | | | text-processing information
* Graph Font.Glyph: Add getFont() (the owner)Sven Gothel2023-03-281-0/+3
|
* Graph FontScale: Simplify names, fix API doc and add unit testSven Gothel2023-03-281-27/+102
|
* Graph Font: Rename getBBox*() -> getBounds*() to preserve a common semantic nameSven Gothel2023-03-271-6/+6
|
* Graph Font Processing: Use Font.GlyphVisitor instead of ↵Sven Gothel2023-03-221-9/+38
| | | | OutlineShape.Visitor, allowing to use the Glyph (information).
* Graph: Font: Add equals() + hash() API doc; GraphUI's Label*.setText(): Only ↵Sven Gothel2023-03-081-0/+18
| | | | modify values if text and/or font differs, skipping markShapeDirty() saves performance.
* Graph Perf: Add Region.countOutlineShape(), Font.processString(Visitor2,..), ↵Sven Gothel2023-03-071-4/+10
| | | | TextRegionUtil.countStringRegion() allowing to use Region.setBufferCapacity()
* Graph Perf: Font*: Remove PerfCounterCtrl since the Region counter is more ↵Sven Gothel2023-03-071-1/+0
| | | | than enough
* Graph: Bring back passing through temp AffineTransform instances (optional, ↵Sven Gothel2023-03-071-12/+18
| | | | but recommended)
* Graph: Use PerfCounterCtrl interface and Instant/Duration & ↵Sven Gothel2023-03-061-8/+2
| | | | Clock.getMonotonicTime() ...
* Graph: Font: Add perf counter (w/ API)Sven Gothel2023-03-061-0/+11
|
* Graph Font.Glyph: Cleanup: Remove Font and getScale() from interface ↵Sven Gothel2023-02-191-12/+7
| | | | (redundant), add getLeftSideBearings*() from htmx table; Flatten TypecastGlyph impl by merging its Metrics, add equal() complementing hashCode()
* Graph Font: Add 'name' to Glyph; Drop erroneous Glyph ID_SPACE, ID_CR manual ↵Sven Gothel2023-02-191-2/+3
| | | | | | | | | | | | | | mapping, rely on no-shape for 'space' non-contour. Drop erroneous Glyph ID_SPACE, ID_CR to rely on no-shape for 'space' non-contour resolves different cmap-mappings of fonts, not following 'some std'. Hence getGlyph(glyph_id) no more uses the `font.getGlyph(Glyph.ID_UNKNOWN)` shape, but a null-shape as intended and using the hmtx and hhea table values for asvance and bounds. This fixes 'space' spacing in general and specifically FreeSerif-Regular and the like. This path also simplifies processing/layout of glyphs in process(..) and get*BoundsFU(..).
* Graph Font.Metrics: Use unchanges sign of (+) ascent, (-) descent and (+) ↵Sven Gothel2023-02-191-22/+33
| | | | lineGap, document them properly and fix Font.getLineHeightFU()
* Graph Font: Enhance API doc (source of values), better get*Bounds() names, ↵Sven Gothel2023-02-161-39/+97
| | | | dropping redundant getMetricWidth*(); Fix getMetricBoundsFU()
* Graph TextRegionUtil: Move ShapeVisitor to OutlineShape.Visitor and ↵Sven Gothel2023-02-153-8/+49
| | | | | | | | | | processString(..) to Font, cleaning up .. Further having Font.processString() return the AABBox of the whole string's 'laidout' OutlineShapes, which is used for (debug) Font.getPointsBounds2(..) just to validate the coordinated with the Glyph based AABBox of Font.getPointsBounds(..). Static TextRegionUtil.drawString(..) no more require to pass the temp AffineTransform instances (ugly).
* Graph Font: getGlyph(char symbol -> int glyph_id), add kerning to ↵Sven Gothel2023-02-141-2/+1
| | | | getPointsBoundsFU(); Glyph: Drop getSymbol()
* Graph Type Rendering: Drop pixelSize and use font em-size [0..1] throughout ↵Sven Gothel2023-02-131-77/+49
| | | | | | | | | system. - All pixelSize metrics methods are dropped in Font* - TypecastGlyph.Advance dropped, i.e. dropping prescales glyph advance based on pixelSize - TextRegionUtil produces OutlineShape in font em-size [0..1] added to GLRegion - Adjusted demos
* Graph font/typecast: Adopt to our Typecast updates (see below); Fix kerning; ↵Sven Gothel2023-02-121-20/+36
| | | | | | | | | Use TestTextRendererNEWT01 to produce validation snaps - Move kerning handling from Font to Font.Glyph using binary-search for right-glyph-id on kerning subset from this instance (left) - TextRegionUtil: Kerning must be added before translation as it applies before the current right-glyph. - TestTextRendererNEWT01 produces validation snapshots against LibreOffice print-preview snapshots - GPUTextRendererListenerBase01 added another text for kerning validation, show more font-size details (pt, px, mm)
* Font/Graph, {Font, Glyph}/Typecast: Add kerning and expose values in ↵Sven Gothel2023-02-102-71/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | original font-units (FU) to have them scaled later ( fu * pixelScale / unitsPerEM ) Scaling from font-units (funits, or FU) is now performed by the renderer itself, i.e. applying the scale-factor 'fontPixelSize / font.getMetrics().getUnitsPerEM()' to the PMV matrix to render the whole graph GLRegion. This finally provides proper device and resolution independent font utilization. Further, preliminary kerning has been added. +++ Also ... TypecastFont: - getGlyphID(..) getGlyph(..) enforce symbol mapping to Glyph.ID_SPACE Glyph.ID_CR, as some fonts ave an erroneous cmap (FreeSerif-Regular) - add getKerning(..) TODO: Add binary search - Set TypecastFont.USE_PRESCALED_ADVANCE := false, i.e. dropping all prescaled pixel-sized advance values mapped to font pixel-size as we utilize font-units only for later uniform scaling. - Drop virtual getPixelSize() and add static FontScale.toPixels(..) - Add fullString() for debugging purposed, including some font tables
* Graph: Complete move jogamp.graph.plane to public com.jogamp.graph.planeSven Gothel2023-02-041-2/+1
|
* Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-141-3/+3
|
* Bug 1237: Adopt GlueGen's clarification of IOUtil.getResource(..), commit ↵Sven Gothel2015-10-031-1/+1
| | | | | | | | d78bb1be0a6290cb94918b21865a023c01825048 - Skip relative lookup for IOUtil.ClassResources using 'asset' only (from JAR file) - Tested w/ jar file and build-dir, see scripts/tests.sh 'USE_BUILDDIR'
* FontFactory: Fix SecurityException as regression of commit ↵Sven Gothel2014-10-091-1/+6
| | | | | | bd24599b21f9787ac989e65b44dc1ba762162f22 - add missing PrivilegedAction around tempFile[0].delete()
* Refine Graph/Font InputStream Capabilities (commit ↵Sven Gothel2014-09-301-12/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 628509b39ea7c16210315d191860511d6be4aa69) FontFactory Remove: - Font get(final URLConnection conn) - Font get(final InputStream stream) FontFactory Add: - [1] Font get(final InputStream stream, final int streamLen, final boolean closeStream) - Direct usage of font InputStream w/ determined length, may instantiate BufferedInputStream in case given stream doesn't support mark/reset! - [2] Font get(final InputStream stream, final boolean closeStream) - Copy font InputStream w/o determined length, resulting in BufferedInputStream supporting mark/reset! Security Related: - Only perform priviledged code on determine InputStream, _not_ when parsing the font stream itself! - Hence PrivilegedAction only happens in FontFactory's InputStream preparation. Misc: - Use Uri class
* Merge remote-tracking branch 'picoworm/master'Sven Gothel2014-09-241-0/+5
|\
| * Added possibility to load font using InputStream parameterRoman2014-07-241-0/+5
| |
* | graph/font: Use 'pixelSize' var-name, remove redundanciesSven Gothel2014-08-281-4/+39
|/
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-4/+4
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Bug 801: Reduce temp. object creation, i.e. GC loadSven Gothel2014-04-021-27/+31
|
* Bug 801: WIP 1/2 - Add color attribute; Switch Shader instead of branching ↵Sven Gothel2014-04-011-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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, ..
* Bug 801: VectorUtil: Pass result vector, allowing caller to manage memory ↵Sven Gothel2014-03-051-2/+12
| | | | (performance, reduce temp objects)
* Bug 801: VBAA Render-Mode Based on SampleCount (not a user-based texWidth) ; ↵Sven Gothel2014-03-012-6/+57
| | | | | | | | | | | | | | Proper FontSize -> PixelSize VBAA Render-Mode Based on SampleCount (not a user-based texWidth) - All Region based APIs now use 'sampleCount' instead of 'texWidth' - VBORegion2PES2 calculates perspective FBO width/height considering the sampleCount Proper FontSize -> PixelSize - Font: Add getPixelSize(fontSize, dpi) - Text* Demos/Classes: Use proper fontSize -> PixelSize
* Bug 801: Enhance API doc of FontSet and FontFactorySven Gothel2014-02-282-10/+18
|
* Bug 801: TextRegionUtil add 'special' for cache-key; Minor editsSven Gothel2014-02-281-0/+3
| | | | | | Minor edits: - Add some docs to curve-shader and remove FIXME remark about gcu_Alpha, which will be used < 1.0. - Font: Add more TTF references
* Bug 801: Graph TextRenderer Cleanup Part-4: Text[Render->Region]Util API: ↵Sven Gothel2014-02-271-1/+5
| | | | Better separation of cached and uncached regions
* Bug 801: Graph TextRenderer Cleanup Part-2: Remove Path2D from ↵Sven Gothel2014-02-271-15/+2
| | | | | | | | | Glyph/Typecast* ; Misc Cleanup Commit c3621221b9a563495b4f54fe60e18e8db8cc57fb introduced create an OutlineShape per Glyph from it's data w/o going through Path2D. Misc Cleanup: Remove unused code/fields, use private/final where possible.
* Bug 802: Graph TextRenderer Performance Part-1 (incomplete, rendering artifacts)Sven Gothel2014-02-241-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strategy Change: - Font.Glyph itself holds it's OutlineShape with it's default scaling. Triangulation is done only once per glyph! - A CharSequence produces a Region by translating and scaling each Glyphs's OutlineShape. This removes the need for re-triangulate - see above. See: TextRendererUtil - The indices of re-added Triangles are offset to the new vertices (FIXME, seems not be be accurate yet). - OutlineShape's vertices and triangles are reused if 'clean'. - Simplified code - Reduced copies API Changes: - OutlineShape, Region, ...: See above - Removed TextRenderer, GlyphShape and GlyphString: Redundant - Added TextRendererUtil to produce the Region from CharSequence Result: - Over 600 fps while changing text for each frame. Previously only ~60fps max. TODO: - Region shall not hold the triangles itself, but the indices instead. This will remove the need to swizzle w/ vertices in the Region Renderer impl and easies reusage of OutlineShapes.
* Merge branch 'master' into stash_glyphcacheSven Gothel2014-02-233-44/+58
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: make/scripts/tests.sh src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java src/jogl/classes/com/jogamp/graph/curve/Region.java src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java src/jogl/classes/com/jogamp/graph/font/Font.java src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java src/jogl/classes/jogamp/graph/curve/text/GlyphString.java src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
| * jogl: add missing @Override annotationsHarvey Harrison2013-10-171-0/+1
| | | | | | | | Signed-off-by: Harvey Harrison <[email protected]>
| * jogl: remove all trailing whitespaceHarvey Harrison2013-10-173-35/+35
| | | | | | | | Signed-off-by: Harvey Harrison <[email protected]>
| * Revise commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e (Bug 767): TAB, BS ↵Sven Gothel2013-07-031-5/+8
| | | | | | | | | | | | | | | | | | and CR/ENTER are printable for NEWT KeyEvent and font handling. Fix regression. - Original behavior was treating CR/ENTER them as printable, lets keep it this way. - KeyEvent: Query these 3 whitespaces upfront, no need to incl. them in 'nonPrintableKeys'. - Fix regression: Native VK_ENTER was not change in commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e.
| * FontConstructor: Hide the exposed strings and add them in class API doc to ↵Sven Gothel2013-06-121-2/+10
| | | | | | | | | | | | | | | | minimize footprint. Review of Harvey. Since accessing the static final exposed strings would trigger static initialization, setting the properties this way would not work anyways (if not inlined ..). Well.
| * Adapt to GlueGen commit 1a01dce6c42b398cdd68d405828774a3ab366456Sven Gothel2013-06-111-3/+5
| |
| * Reorganize math code into: com.jogamp.opengl.math and ↵Sven Gothel2012-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | com.jogamp.opengl.math.geom packages Note: WIP - We may relocate / reorg math package. Public relocations: com.jogamp.opengl.util -> com.jogamp.opengl.math - FixedPoint - FloatUtil com.jogamp.graph.math -> com.jogamp.opengl.math - Quaternion - VectorUtil com.jogamp.graph.geom -> com.jogamp.opengl.math.geom - AABBox VectorUtil: Introducing Vert2fImmutable and Vert3fImmutable interfaces, allowing graph Vertex instances to be used 'graph' agnostic and to document 2d/3d use-cases.
* | Bug 801: Graph TextRenderer Cleanup Part-1a (unclean)Sven Gothel2014-02-231-0/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remark: This commit is unclean and requires 'Part-1b' due to merging this commit after more than 2 years! Graph: - Use List<OutlineShape> instead of array allowing more flexible memory managment. - GLRegion -> Region promotion: - Region create(List<OutlineShape> outlineShapes, int renderModes) - Region create(OutlineShape outlineShape, int renderModes) - Region additions - void addOutlineShape(OutlineShape shape) - void addOutlineShapes(List<OutlineShape> shapes) - RegionRenderer - draw(..) remove 'position', redundant - - Deprecate 'TextRenderer' and 'GlyphString' Use Region.create(Font.getOutlineShapes(...)) + RegionRenderer instead. - FontInt -> Font promotion (make public) - getOutlineShape and getOutlineShapes - Font.Glyph additions - 'getID(), hashCode()' - 'float getScale(float pixelSize)' - GlyphShape - Add reference to Glyph allowing GlyphString to access the font metrics for translation and scaling - Experimental pre-scale/translation in GlyphString using default font size and it's metrics
* graph/font: Add "public float getAdvanceWidth(int i, float pixelSize);"Sven Gothel2012-05-151-0/+1
| | | | | Font::getAdvancedWidth(..) allows applications to query a glyphs width with a given pixel size, as it is being used for rendering.
* Graph/Glyph: Clarify public Font.Glyph and private FontInt.GlyphIntSven Gothel2012-05-151-0/+6
|
* Adapt to GlueGen IO resource changes URL -> URLConnection for effeciency; ↵Sven Gothel2012-03-171-3/+3
| | | | | | | | | | API doc enhancements; Minor edits - API doc added/enhanced: - ShaderCode - ShaderUtil - NewtBaseActivity: Clarify method / var names