JOGL: src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java Source File

JOGL v2.6.0 JOGL, High-Performance Graphics Binding for Java™ (public API).

Glyph05FreeSerifBoldItalic_ae.java
Go to the documentation of this file.
1/**
2 * Copyright 2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.demos.graph.ui.testshapes;
29
30import com.jogamp.graph.curve.OutlineShape;
31import com.jogamp.graph.ui.GraphShape;
32import com.jogamp.opengl.GL2ES2;
33import com.jogamp.opengl.GLProfile;
34
35/**
36 * GPU based resolution independent test object
37 * - FreeSans, '0'
38 * - TTF Shape for Glyph 19
39 */
40 public class Glyph05FreeSerifBoldItalic_ae extends GraphShape {
41
42 public Glyph05FreeSerifBoldItalic_ae(final int renderModes) {
43 super(renderModes);
44 }
45
46 @Override
47 protected void addShapeToRegion(final GLProfile glp, final GL2ES2 gl) {
48 final OutlineShape shape = new OutlineShape();
49
50 // Start TTF Shape for Glyph 168
51 // 000: B0a: move-to p0
52 // Shape.MoveTo:
53 shape.closeLastOutline(false);
54 shape.addEmptyOutline();
55 shape.addVertex(0, 0.450000f, -0.013000f, true);
56 // 000: B4: quad-to p0-p1-p2h **** MID
57 // Shape.QuadTo:
58 shape.addVertex(0, 0.386000f, -0.013000f, false);
59 shape.addVertex(0, 0.353000f, 0.018000f, true);
60 // 002: B6: quad-to pMh-p0-p1
61 // Shape.QuadTo:
62 shape.addVertex(0, 0.319000f, 0.049000f, false);
63 shape.addVertex(0, 0.307000f, 0.118000f, true);
64 // 003: B4: quad-to p0-p1-p2h **** MID
65 // Shape.QuadTo:
66 shape.addVertex(0, 0.265000f, 0.049000f, false);
67 shape.addVertex(0, 0.225000f, 0.019000f, true);
68 // 005: B6: quad-to pMh-p0-p1
69 // Shape.QuadTo:
70 shape.addVertex(0, 0.184000f, -0.012000f, false);
71 shape.addVertex(0, 0.134000f, -0.012000f, true);
72 // 006: B4: quad-to p0-p1-p2h **** MID
73 // Shape.QuadTo:
74 shape.addVertex(0, 0.085000f, -0.012000f, false);
75 shape.addVertex(0, 0.053000f, 0.021000f, true);
76 // 008: B6: quad-to pMh-p0-p1
77 // Shape.QuadTo:
78 shape.addVertex(0, 0.020000f, 0.055000f, false);
79 shape.addVertex(0, 0.020000f, 0.106000f, true);
80 // 009: B4: quad-to p0-p1-p2h **** MID
81 // Shape.QuadTo:
82 shape.addVertex(0, 0.020000f, 0.185000f, false);
83 shape.addVertex(0, 0.062000f, 0.269000f, true);
84 // 011: B5: quad-to pMh-p0-p1h ***** MID
85 // Shape.QuadTo:
86 shape.addVertex(0, 0.105000f, 0.353000f, false);
87 shape.addVertex(0, 0.170000f, 0.407000f, true);
88 // 012: B6: quad-to pMh-p0-p1
89 // Shape.QuadTo:
90 shape.addVertex(0, 0.235000f, 0.462000f, false);
91 shape.addVertex(0, 0.296000f, 0.462000f, true);
92 // 013: B4: quad-to p0-p1-p2h **** MID
93 // Shape.QuadTo:
94 shape.addVertex(0, 0.328000f, 0.462000f, false);
95 shape.addVertex(0, 0.346000f, 0.448000f, true);
96 // 015: B6: quad-to pMh-p0-p1
97 // Shape.QuadTo:
98 shape.addVertex(0, 0.364000f, 0.433000f, false);
99 shape.addVertex(0, 0.377000f, 0.396000f, true);
100 // 016: B1: line-to p0-p1
101 // Shape.LineTo:
102 shape.addVertex(0, 0.395000f, 0.454000f, true);
103 // 017: B1: line-to p0-p1
104 // Shape.LineTo:
105 shape.addVertex(0, 0.498000f, 0.459000f, true);
106 // 018: B1: line-to p0-p1
107 // Shape.LineTo:
108 shape.addVertex(0, 0.478000f, 0.394000f, true);
109 // 019: B4: quad-to p0-p1-p2h **** MID
110 // Shape.QuadTo:
111 shape.addVertex(0, 0.510000f, 0.431000f, false);
112 shape.addVertex(0, 0.535000f, 0.445000f, true);
113 // 021: B6: quad-to pMh-p0-p1
114 // Shape.QuadTo:
115 shape.addVertex(0, 0.561000f, 0.459000f, false);
116 shape.addVertex(0, 0.598000f, 0.459000f, true);
117 // 022: B4: quad-to p0-p1-p2h **** MID
118 // Shape.QuadTo:
119 shape.addVertex(0, 0.645000f, 0.459000f, false);
120 shape.addVertex(0, 0.671000f, 0.436000f, true);
121 // 024: B6: quad-to pMh-p0-p1
122 // Shape.QuadTo:
123 shape.addVertex(0, 0.698000f, 0.413000f, false);
124 shape.addVertex(0, 0.698000f, 0.372000f, true);
125 // 025: B4: quad-to p0-p1-p2h **** MID
126 // Shape.QuadTo:
127 shape.addVertex(0, 0.698000f, 0.310000f, false);
128 shape.addVertex(0, 0.639000f, 0.263000f, true);
129 // 027: B6: quad-to pMh-p0-p1
130 // Shape.QuadTo:
131 shape.addVertex(0, 0.579000f, 0.215000f, false);
132 shape.addVertex(0, 0.470000f, 0.190000f, true);
133 // 028: B1: line-to p0-p1
134 // Shape.LineTo:
135 shape.addVertex(0, 0.431000f, 0.181000f, true);
136 // 029: B2: quad-to p0-p1-p2
137 // Shape.QuadTo:
138 shape.addVertex(0, 0.426000f, 0.156000f, false);
139 shape.addVertex(0, 0.426000f, 0.134000f, true);
140 // 031: B4: quad-to p0-p1-p2h **** MID
141 // Shape.QuadTo:
142 shape.addVertex(0, 0.426000f, 0.096000f, false);
143 shape.addVertex(0, 0.444000f, 0.073000f, true);
144 // 033: B6: quad-to pMh-p0-p1
145 // Shape.QuadTo:
146 shape.addVertex(0, 0.462000f, 0.050000f, false);
147 shape.addVertex(0, 0.493000f, 0.050000f, true);
148 // 034: B2: quad-to p0-p1-p2
149 // Shape.QuadTo:
150 shape.addVertex(0, 0.565000f, 0.050000f, false);
151 shape.addVertex(0, 0.616000f, 0.139000f, true);
152 // 036: B1: line-to p0-p1
153 // Shape.LineTo:
154 shape.addVertex(0, 0.644000f, 0.122000f, true);
155 // 037: B2: quad-to p0-p1-p2
156 // Shape.QuadTo:
157 shape.addVertex(0, 0.578000f, -0.013000f, false);
158 shape.addVertex(0, 0.450000f, -0.013000f, true);
159 System.err.println("Glyph05FreeSerifBoldItalic_ae.shape01a.winding_area: "+shape.getWindingOfLastOutline());
160 shape.closeLastOutline(false);
161
162 // 039: B0a: move-to p0
163 // Shape.MoveTo:
164 shape.closeLastOutline(false);
165 shape.addEmptyOutline();
166 shape.addVertex(0, 0.194000f, 0.058000f, true);
167 // 039: B4: quad-to p0-p1-p2h **** MID
168 // Shape.QuadTo:
169 shape.addVertex(0, 0.238000f, 0.058000f, false);
170 shape.addVertex(0, 0.278000f, 0.122000f, true);
171 // 041: B5: quad-to pMh-p0-p1h ***** MID
172 // Shape.QuadTo:
173 shape.addVertex(0, 0.319000f, 0.187000f, false);
174 shape.addVertex(0, 0.338000f, 0.256000f, true);
175 // 042: B6: quad-to pMh-p0-p1
176 // Shape.QuadTo:
177 shape.addVertex(0, 0.358000f, 0.326000f, false);
178 shape.addVertex(0, 0.358000f, 0.363000f, true);
179 // 043: B4: quad-to p0-p1-p2h **** MID
180 // Shape.QuadTo:
181 shape.addVertex(0, 0.358000f, 0.387000f, false);
182 shape.addVertex(0, 0.345000f, 0.403000f, true);
183 // 045: B6: quad-to pMh-p0-p1
184 // Shape.QuadTo:
185 shape.addVertex(0, 0.331000f, 0.419000f, false);
186 shape.addVertex(0, 0.310000f, 0.419000f, true);
187 // 046: B4: quad-to p0-p1-p2h **** MID
188 // Shape.QuadTo:
189 shape.addVertex(0, 0.267000f, 0.419000f, false);
190 shape.addVertex(0, 0.227000f, 0.356000f, true);
191 // 048: B5: quad-to pMh-p0-p1h ***** MID
192 // Shape.QuadTo:
193 shape.addVertex(0, 0.187000f, 0.293000f, false);
194 shape.addVertex(0, 0.167000f, 0.225000f, true);
195 // 049: B6: quad-to pMh-p0-p1
196 // Shape.QuadTo:
197 shape.addVertex(0, 0.146000f, 0.156000f, false);
198 shape.addVertex(0, 0.146000f, 0.119000f, true);
199 // 050: B4: quad-to p0-p1-p2h **** MID
200 // Shape.QuadTo:
201 shape.addVertex(0, 0.146000f, 0.092000f, false);
202 shape.addVertex(0, 0.159000f, 0.075000f, true);
203 // 052: B6: quad-to pMh-p0-p1
204 // Shape.QuadTo:
205 shape.addVertex(0, 0.172000f, 0.058000f, false);
206 shape.addVertex(0, 0.194000f, 0.058000f, true);
207 System.err.println("Glyph05FreeSerifBoldItalic_ae.shape02a.winding_area: "+shape.getWindingOfLastOutline());
208 shape.closeLastOutline(false);
209
210 if( true ) {
211 // GlyphShape<168>: offset 0 of 8/61 points
212 // pM[060] P[443/231, on true, end true]
213 // p0[053] P[438/214, on true, end false]
214 // p1[054] P[498/223, on false, end false]
215 // p2[055] P[608/320, on false, end false]
216 // 053: B0a: move-to p0
217 // Shape.MoveTo:
218 shape.closeLastOutline(false);
219 shape.addEmptyOutline();
220 shape.addVertex(0, 0.438000f, 0.214000f, true);
221 // 053: B4: quad-to p0-p1-p2h **** MID
222 // Shape.QuadTo:
223 shape.addVertex(0, 0.498000f, 0.223000f, false);
224 shape.addVertex(0, 0.553000f, 0.271000f, true);
225 // GlyphShape<168>: offset 2 of 8/61 points
226 // pM[054] P[498/223, on false, end false]
227 // p0[055] P[608/320, on false, end false]
228 // p1[056] P[608/388, on true, end false]
229 // p2[057] P[608/429, on false, end false]
230 // 055: B6: quad-to pMh-p0-p1
231 // Shape.QuadTo:
232 shape.addVertex(0, 0.608000f, 0.320000f, false);
233 shape.addVertex(0, 0.608000f, 0.388000f, true);
234 // GlyphShape<168>: offset 3 of 8/61 points
235 // pM[055] P[608/320, on false, end false]
236 // p0[056] P[608/388, on true, end false]
237 // p1[057] P[608/429, on false, end false]
238 // p2[058] P[575/429, on true, end false]
239 // 056: B2: quad-to p0-p1-p2
240 // Shape.QuadTo:
241 shape.addVertex(0, 0.608000f, 0.429000f, false);
242 shape.addVertex(0, 0.575000f, 0.429000f, true);
243 // GlyphShape<168>: offset 5 of 8/61 points
244 // pM[057] P[608/429, on false, end false]
245 // p0[058] P[575/429, on true, end false]
246 // p1[059] P[502/429, on false, end false]
247 // p2[060] P[443/231, on true, end true]
248 // 058: B2: quad-to p0-p1-p2
249 // Shape.QuadTo:
250 shape.addVertex(0, 0.502000f, 0.429000f, false);
251 shape.addVertex(0, 0.443000f, 0.231000f, true);
252 // GlyphShape<168>: offset 7 of 8/61 points
253 // pM[059] P[502/429, on false, end false]
254 // p0[060] P[443/231, on true, end true]
255 // p1[053] P[438/214, on true, end false]
256 // p2[054] P[498/223, on false, end false]
257 // 060: B1: line-to p0-p1
258 // Shape.LineTo:
259 shape.addVertex(0, 0.438000f, 0.214000f, true);
260 System.err.println("Glyph05FreeSerifBoldItalic_ae.shape03a.winding_area: "+shape.getWindingOfLastOutline());
261 shape.closeLastOutline(false);
262 }
263
264 // End Shape for Glyph 168
265
266 shape.setIsQuadraticNurbs();
267 shape.setSharpness(oshapeSharpness);
268
269 resetGLRegion(glp, gl, null, shape);
270 region.addOutlineShape(shape, null, rgbaColor);
271 box.resize(shape.getBounds());
272 setRotationPivot( box.getCenter() );
273 }
274
275 @Override
276 public String getSubString() {
277 return super.getSubString();
278 }
279}
com.jogamp.graph.curve.OutlineShape
A Generic shape objects which is defined by a list of Outlines.
Definition: OutlineShape.java:123
com.jogamp.graph.curve.OutlineShape.getWindingOfLastOutline
final Winding getWindingOfLastOutline()
Compute the Winding of the getLastOutline() using the VectorUtil#area(ArrayList) function over all of...
Definition: OutlineShape.java:266
com.jogamp.graph.curve.OutlineShape.addVertex
final void addVertex(final Vertex v)
Adds a vertex to the last open outline to the shape's tail.
Definition: OutlineShape.java:459
com.jogamp.graph.curve.OutlineShape.setIsQuadraticNurbs
final void setIsQuadraticNurbs()
Claim this outline's vertices are all OutlineShape.VerticesState#QUADRATIC_NURBS, hence no cubic tran...
Definition: OutlineShape.java:837
com.jogamp.graph.curve.OutlineShape.getBounds
final AABBox getBounds()
Definition: OutlineShape.java:1140
com.jogamp.graph.curve.OutlineShape.setSharpness
final void setSharpness(final float s)
Sets sharpness, defaults to DEFAULT_SHARPNESS.
Definition: OutlineShape.java:217
com.jogamp.graph.curve.OutlineShape.closeLastOutline
final void closeLastOutline(final boolean closeTail)
Closes the last outline in the shape.
Definition: OutlineShape.java:584
com.jogamp.graph.curve.OutlineShape.addEmptyOutline
final void addEmptyOutline()
Add a new empty Outline to the end of this shape's outline list.
Definition: OutlineShape.java:331
com.jogamp.graph.curve.Region.addOutlineShape
final void addOutlineShape(final OutlineShape shape, final AffineTransform t, final Vec4f rgbaColor)
Add the given OutlineShape to this region with the given optional AffineTransform.
Definition: Region.java:616
com.jogamp.graph.ui.GraphShape
Graph based GLRegion Shape.
Definition: GraphShape.java:55
com.jogamp.graph.ui.GraphShape.oshapeSharpness
float oshapeSharpness
Definition: GraphShape.java:60
com.jogamp.graph.ui.GraphShape.renderModes
int renderModes
Definition: GraphShape.java:57
com.jogamp.graph.ui.GraphShape.region
GLRegion region
Definition: GraphShape.java:59
com.jogamp.graph.ui.GraphShape.resetGLRegion
final void resetGLRegion(final GLProfile glp, final GL2ES2 gl, final TextureSequence colorTexSeq, int vertexCount, int indexCount)
Reset the GLRegion and reserving its buffers to have a free capacity for vertexCount and indexCount e...
Definition: GraphShape.java:184
com.jogamp.graph.ui.Shape.box
final AABBox box
Definition: Shape.java:245
com.jogamp.graph.ui.Shape.rgbaColor
final Vec4f rgbaColor
Default base-color w/o color channel, will be modulated w/ pressed- and toggle color.
Definition: Shape.java:261
com.jogamp.graph.ui.Shape.setRotationPivot
final Shape setRotationPivot(final float px, final float py, final float pz)
Set unscaled rotation origin, aka pivot.
Definition: Shape.java:620
com.jogamp.math.geom.AABBox.resize
final AABBox resize(final AABBox newBox)
Resize the AABBox to encapsulate another AABox.
Definition: AABBox.java:274
com.jogamp.math.geom.AABBox.getCenter
final Vec3f getCenter()
Returns computed center of this AABBox of getLow() and getHigh().
Definition: AABBox.java:737
com.jogamp.opengl.GLProfile
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
com.jogamp.opengl.demos.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae
GPU based resolution independent test object.
Definition: Glyph05FreeSerifBoldItalic_ae.java:40
com.jogamp.opengl.demos.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae.Glyph05FreeSerifBoldItalic_ae
Glyph05FreeSerifBoldItalic_ae(final int renderModes)
Definition: Glyph05FreeSerifBoldItalic_ae.java:42
com.jogamp.opengl.demos.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae.getSubString
String getSubString()
Definition: Glyph05FreeSerifBoldItalic_ae.java:276
com.jogamp.opengl.demos.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae.addShapeToRegion
void addShapeToRegion(final GLProfile glp, final GL2ES2 gl)
Definition: Glyph05FreeSerifBoldItalic_ae.java:47
com.jogamp.opengl.GL2ES2
Definition: GL2ES2.java:29