Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: So Mai 12, 2024 22:11

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 35 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mo Aug 25, 2008 14:21 
Offline
DGL Member

Registriert: Di Aug 26, 2003 20:08
Beiträge: 81
Wohnort: Mönchengladbach
Programmiersprache: ObjPas ASM C C++ etc
At my BeRoVectorFont TTF Font Loader implementation:

bvfctMOVETO begins an path, and bvfctCLOSE closes an path.

Code:
  1.  
  2.   for i:=0 to length(FontCommands)-1 do begin
  3.    case FontCommands[i].Command of
  4.     bvfctMOVETO:begin
  5.      // New path with FontCommands[i].x and FontCommands[i].y as beginning point
  6.     end;
  7.     bvfctLINETO:begin
  8.      // New line in the current path with FontCommands[i].x and FontCommands[i].y as end point of the line
  9.     end;
  10.     bvfctQUADRATICCURVETO:begin
  11.      // New quadratic curve in the current path with current pen point as control point 1, FontCommands[i].qcx and FontCommands[i].qcy as control point 2, and  FontCommands[i].qax and FontCommands[i].qay as anchor point
  12.     end;
  13.     bvfctCLOSE:begin
  14.      // Close the current path
  15.     end;
  16.    end;
  17.  

_________________
Behindert ist man nicht, behindert wird man.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Aug 25, 2008 18:59 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Have not yet tested your fontreader.

The problem for me is i am using the glu tesselator to make outlines also. Needed for some polygons like the star shape i use (a worse case scenario).
'Lucky' while tesselating the outline i get 2 calls to begin when making outlines for the i char. So problem solved.

Dont know wether your font reader treats a single char like one closed path when possible. E.g. the font reader i use and gdi getpath return 'broken' shapes. E.g. even chars other then 'i' contain multiple polygons/segments even those wihout holes.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 17, 2009 07:39 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
I assume there has been no progress with Vector Fonts?

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 17, 2009 18:11 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
It is still on my todo list to finish up... Be patient... But it is in a better working state then described here...

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 23, 2009 20:34 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
A small showcase of the fileformat:

Code:
  1.  
  2. 65: M 625.203125 302 L 625.203125 302 L 274.046875 302 L 274.046875 302 L 213 159.96875 C 213 159.96875 190.34375 107.4375 190.34375 81.515625 C 190.34375 81.515625 190.34375 60.90625 210 45.28125 C 210 45.28125 229.65625 29.65625 294.984375 25 L 294.984375 25 L 294.984375 0 L 294.984375 0 L 9.328125 0 L 9.328125 0 L 9.328125 25 C 9.328125 25 65.984375 35 82.640625 51.015625 C 82.640625 51.015625 116.625 83.03125 157.953125 181.078125 L 157.953125 181.078125 L 476.203125 924 L 476.203125 924 L 500.265625 924 L 500.265625 924 L 815 172.625 C 815 172.625 852.984375 82.1875 883.9765625 55.2578125 C 883.9765625 55.2578125 914.96875 28.328125 970.296875 25 L 970.296875 25 L 970.296875 0 L 970.296875 0 L 613.71875 0 L 613.71875 0 L 613.71875 25 C 613.71875 25 667.703125 27.65625 686.6953125 42.953125 C 686.6953125 42.953125 705.6875 58.25 705.6875 80.203125 C 705.6875 80.203125 705.6875 109.46875 679.03125 172.640625 L 679.03125 172.640625 M 604.828125 351 L 604.828125 351 L 452.5 716.234375 L 452.5 716.234375 L 295.109375 351 L 295.109375 351 z
  3.  


So the actual reading of the (ttf) font is now seperated into a convert tool giving the above for 'A' . And the rendering that reads the above.
And yes the above should be compatible with SVG. it is just missing the xml.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 25, 2009 04:50 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Have you fixed the tesselation so triangles are created properly?

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 25, 2009 18:21 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
yes. The i character looks right for a long time now. But the code is not in fit shape to be published yet. i can give a name for the project it is part of 'glvg'. if all goes well i might publish something this weekend under my usual mpl license...

Bild

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 25, 2009 22:26 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Nice. Sooner we can throw away Bitmap fonts the better.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 28, 2009 18:30 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I wont do a sourcecode release this weekend yet. I was not able clean up all the rough edges.

Also i forgot that my example had a mirrored setup. So in order to draw basic svg paths correctly i made a proper glOrtho setup.
Unfortunately now fonts are upside down. Who on earth decided that fonts should be stored upside down :-(
Upon investigation it also seems that svg fonts are also upside down. E.g. take the path out of glyph and put it in a vector shape and it is upside down.
So i should find an easy and fast way of getting the font displayed the right way up.

[EDIT]
:oops: Oops its the svg coord system not the font that is inverted. Once again i go haywire with al the different coord systems :x

as i have:
svg coord system
opengl coord system
font coord system

who is willing to explain these coord system with grahics?
[/EDIT]

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 28, 2009 19:41 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Font Coord system is proberly top left, SVG uses top left and OpenGL as you would know would be bottom left.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 28, 2009 19:57 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Alas font coord is not equal to svg coord system:
(try to view this with a svg viewer)

Code:
  1.  
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <svg version="1.2" baseProfile="tiny" viewBox="0 0 260 270"  xmlns="http://www.w3.org/2000/svg"
  4.     xmlns:xlink="http://www.w3.org/1999/xlink">
  5.     <title>Font example</title>
  6.     <defs>
  7.         <font horiz-adv-x="313" xml:id="la">
  8.             <metadata>Converted from Larabie Anglepoise by Batik ttf2svg
  9.             See http://www.larabiefonts.com/ </metadata>
  10.             <font-face font-family="larabie-anglepoise" units-per-em="1000"
  11.                 panose-1="0 0 4 0 0 0 0 0 0 0" ascent="703" descent="-300" alphabetic="0"/>
  12.             <missing-glyph horiz-adv-x="500" d="M63 0V700H438V0H63ZM125 63H375V638H125V63Z"/>
  13.             <glyph unicode="S" glyph-name="S" horiz-adv-x="385" d="M371 1H29V144H264Q264 151 264
  14.                 166Q265 180 265 188Q265 212 249 212H132Q83 212 55 247Q29 279 29
  15.                 329V566H335V422H136V375Q136 360 144 356Q148 355 168 355H279Q327 355 352 309Q371 273
  16.                 371 221V1Z"/>
  17.             <glyph unicode="V" glyph-name="V" horiz-adv-x="351" d="M365 563L183 -33L0 563H101L183
  18.                 296L270 563H365Z"/>
  19.             <glyph unicode="G" glyph-name="G" horiz-adv-x="367" d="M355
  20.                 1H18V564H355V420H125V144H248V211H156V355H355V1Z"/>
  21.             <hkern g1="V" g2="G" k="-40"/>
  22.         </font>
  23.     </defs>
  24.     <text x="40" y="50" font-family="larabie-anglepoise" font-size="70" fill="#933">SVG</text>
  25.     <rect x="00" y="00" width="160" height="70" stroke="#777" fill="none"/>
  26.     <path fill="none" stroke="red" stroke-width="5" d="M355,1 H18 V564 H355 V420 H125 V144 H248 V211 H156 V355 H355 V1Z" />
  27. </svg>
  28.  


More info here on how to create svg fonts:
http://www.treebuilder.de/default.asp?file=898693.xml
so mirror the y axis in an efficient way is the solution...

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Mär 29, 2009 14:15 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
To mirror the Y Axis wouldn't you have to work out the size of every character in the font to get the overall height of the characters?

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Mär 29, 2009 14:41 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
yes, and i cheat for now :-)

here is a pre alpha release:

oh you use the source on your own risk. (so dont blame me if it blows up your pc or damages your acounting)


Dateianhänge:
Dateikommentar: Pre alpha release of glvg.
glvg-1a.zip [73.62 KiB]
380-mal heruntergeladen

_________________
http://3das.noeska.com - create adventure games without programming
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 04, 2009 13:53 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
For those who are interested here is the svn repository for glvg: http://thuis.vanderhoning.net/svn_glvg/trunk/

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jul 15, 2009 16:28 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
There is a flaw with your code since you use NameValueSeparator. For Delphi's that don't support the NameValueSeparator the Stringlist will never give any value, making the font loading fail compleatly. This is solved by using the default = in the ConvertFont app instead of the : .

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 35 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.020s | 19 Queries | GZIP : On ]