|
Post by alexfish on Jun 28, 2016 20:08:33 GMT 1
Hi Vovchik
Not going to test the above yet.
have looked closer at the original code , since think Here need to resolve this SEGFAULT & why different systems = different Numbers Or What ever == segfault at what point or value is that particular ARRAY[x] , is it greater that the count or is there a -val ..
Anyway , found that if miss the info about the the font every thing here appears to be working..
so can test this , if it works on your sys then note the actual positions and what U can See , Re bounding box . not sure sure if some of this relates to what was posted on the other thread , but here think this = Minor issue
Comment out Line
stbtt_GetCodepointHMetrics(&info, array_glyph, &advanceWidth, &leftSideBearing) PEN(1.0, 1) INK(0, 0, 0, 255) CLS INK(128, 128, 128, 240) GRID(0, 0, canvas_w, canvas_h, canvas_w/50, canvas_h/50) PEN(2.0, 1) INK(255, 215, 0, 255) 'TEXT("TTF vertices for value " & STR$(array_glyph + 29) & " = '" & \ CHR$(array_glyph + 29) & "' (array index = " & STR$(array_glyph) & ")", 70, 40) IF vidx > 0 THEN
BR Alex
|
|
|
Post by alexfish on Jul 3, 2016 12:31:54 GMT 1
Hi Vovchik
been hacking around the bounding boxes etc etc etc
I keep falling back to svg embed for placement , best explained in this bit of code , extracted from U'r latest demo
here the first font is a per demo , the second font is the embed svg with offset to the right x = blagh , as can see the text can be rotate within reasonable bounds
Updated:: Math wise , it should be easy to plot any path or direction . + can have Simple Italic fonts just using the rotation , all with the info as is .. per lastest U'r demo BR Alex
<svg width='650' height='150' viewBox='0 0 650 650' transform='translate(0, 0)' > <line x1='0' y1='0' x2='650' y2='650' stroke='blue' stroke-width='2' /> <line x1='0' y1='650' x2='650' y2='0' stroke='blue' stroke-width='2' /> <path transform='rotate( 180,325,325)' ch_name='2' ch_width='400' ch_xoff='25' fill='red' stroke='gold' stroke-width='15' d='M0, 0 M296.5, 141 Q305.5, 141 305.5, 155 Q305.5, 169 292, 172 Q290.5, 175 290.5, 178 Q290.5, 181 298, 186.5 Q305.5, 191.5 310.5, 199 Q316, 206 316, 218 Q316, 229.5 313.5, 239 Q311.5, 248 301, 257.5 Q286, 270.5 267, 270.5 Q249, 270.5 233.5, 259 Q217.5, 241.5 217.5, 218.5 Q217.5, 212 220.5, 198.5 Q223.5, 185 241, 168.5 Q258.5, 152 273.5, 148 Q288.5, 143.5 296.5, 141 M336.5, 139 L349.5 140 Q375.5, 142 400.5, 157 Q426, 172 437.5, 191.5 Q449, 210.5 449, 236.5 Q449, 262.5 440.5, 281 Q424, 319 362.5, 345 Q301, 371 290, 379.5 Q281, 380.5 267, 384.5 Q253.5, 388.5 250.5, 389 Q250, 388.5 250.5, 386 Q258.5, 376 297.5, 343 Q336.5, 310 341.5, 285.5 Q347, 261 347, 240 Q347, 200.5 335.5, 175 Q325.5, 170 325.5, 159 Q326, 147.5 326, 143 Q329, 139 336.5, 139 M226, 489.5 Q219, 489.5 215, 479 Q215, 456.5 228, 436 Q241.5, 415.5 257, 409.5 Q279.5, 400.5 300.5, 400.5 Q321.5, 400.5 357, 407 Q392.5, 413 402.5, 413 Q412.5, 413 417, 412.5 Q422, 411.5 427, 408 Q432.5, 404.5 436.5, 392.5 Q440.5, 380.5 447.5, 380.5 Q450, 380.5 453, 382 Q456, 383 457, 383.5 Q458.5, 384 458.5, 386.5 Q458.5, 415.5 449, 439.5 Q440, 463.5 424, 476.5 Q408, 489.5 396, 493.5 Q384.5, 497 370, 497 Q356, 497 316, 486.5 Q276, 475.5 260.5, 475.5 Q253.5, 473.5 241.5, 481.5 Q230, 489.5 226, 489.5 z' /> <svg x = '400'> <path transform='rotate( 90,325,325)' ch_name='2' ch_width='400' ch_xoff='25' fill='red' stroke='gold' stroke-width='15' d='M0, 0 M296.5, 141 Q305.5, 141 305.5, 155 Q305.5, 169 292, 172 Q290.5, 175 290.5, 178 Q290.5, 181 298, 186.5 Q305.5, 191.5 310.5, 199 Q316, 206 316, 218 Q316, 229.5 313.5, 239 Q311.5, 248 301, 257.5 Q286, 270.5 267, 270.5 Q249, 270.5 233.5, 259 Q217.5, 241.5 217.5, 218.5 Q217.5, 212 220.5, 198.5 Q223.5, 185 241, 168.5 Q258.5, 152 273.5, 148 Q288.5, 143.5 296.5, 141 M336.5, 139 L349.5 140 Q375.5, 142 400.5, 157 Q426, 172 437.5, 191.5 Q449, 210.5 449, 236.5 Q449, 262.5 440.5, 281 Q424, 319 362.5, 345 Q301, 371 290, 379.5 Q281, 380.5 267, 384.5 Q253.5, 388.5 250.5, 389 Q250, 388.5 250.5, 386 Q258.5, 376 297.5, 343 Q336.5, 310 341.5, 285.5 Q347, 261 347, 240 Q347, 200.5 335.5, 175 Q325.5, 170 325.5, 159 Q326, 147.5 326, 143 Q329, 139 336.5, 139 M226, 489.5 Q219, 489.5 215, 479 Q215, 456.5 228, 436 Q241.5, 415.5 257, 409.5 Q279.5, 400.5 300.5, 400.5 Q321.5, 400.5 357, 407 Q392.5, 413 402.5, 413 Q412.5, 413 417, 412.5 Q422, 411.5 427, 408 Q432.5, 404.5 436.5, 392.5 Q440.5, 380.5 447.5, 380.5 Q450, 380.5 453, 382 Q456, 383 457, 383.5 Q458.5, 384 458.5, 386.5 Q458.5, 415.5 449, 439.5 Q440, 463.5 424, 476.5 Q408, 489.5 396, 493.5 Q384.5, 497 370, 497 Q356, 497 316, 486.5 Q276, 475.5 260.5, 475.5 Q253.5, 473.5 241.5, 481.5 Q230, 489.5 226, 489.5 z' /> </svg>
<svg x = '700'> <path transform='rotate( 12,325,325)' ch_name='2' ch_width='400' ch_xoff='25' fill='green' stroke='gold' stroke-width='15' d='M0, 0 M296.5, 141 Q305.5, 141 305.5, 155 Q305.5, 169 292, 172 Q290.5, 175 290.5, 178 Q290.5, 181 298, 186.5 Q305.5, 191.5 310.5, 199 Q316, 206 316, 218 Q316, 229.5 313.5, 239 Q311.5, 248 301, 257.5 Q286, 270.5 267, 270.5 Q249, 270.5 233.5, 259 Q217.5, 241.5 217.5, 218.5 Q217.5, 212 220.5, 198.5 Q223.5, 185 241, 168.5 Q258.5, 152 273.5, 148 Q288.5, 143.5 296.5, 141 M336.5, 139 L349.5 140 Q375.5, 142 400.5, 157 Q426, 172 437.5, 191.5 Q449, 210.5 449, 236.5 Q449, 262.5 440.5, 281 Q424, 319 362.5, 345 Q301, 371 290, 379.5 Q281, 380.5 267, 384.5 Q253.5, 388.5 250.5, 389 Q250, 388.5 250.5, 386 Q258.5, 376 297.5, 343 Q336.5, 310 341.5, 285.5 Q347, 261 347, 240 Q347, 200.5 335.5, 175 Q325.5, 170 325.5, 159 Q326, 147.5 326, 143 Q329, 139 336.5, 139 M226, 489.5 Q219, 489.5 215, 479 Q215, 456.5 228, 436 Q241.5, 415.5 257, 409.5 Q279.5, 400.5 300.5, 400.5 Q321.5, 400.5 357, 407 Q392.5, 413 402.5, 413 Q412.5, 413 417, 412.5 Q422, 411.5 427, 408 Q432.5, 404.5 436.5, 392.5 Q440.5, 380.5 447.5, 380.5 Q450, 380.5 453, 382 Q456, 383 457, 383.5 Q458.5, 384 458.5, 386.5 Q458.5, 415.5 449, 439.5 Q440, 463.5 424, 476.5 Q408, 489.5 396, 493.5 Q384.5, 497 370, 497 Q356, 497 316, 486.5 Q276, 475.5 260.5, 475.5 Q253.5, 473.5 241.5, 481.5 Q230, 489.5 226, 489.5 z' /> </svg> </svg>
|
|