Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4324408
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:07:42+00:00 2026-05-21T09:07:42+00:00

What is the formula to draw a line in x, y space given b-spline

  • 0

What is the formula to draw a line in x, y space given b-spline coordinates in a TrueType font?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:07:43+00:00Added an answer on May 21, 2026 at 9:07 am

    Please note that Truetype allows for bspline curves AND straight lines within a glyph definition.

    If you need to change these commands into a series of MoveTo’s and LineTo’s you can use the following:

    1. Convert the TrueType data into a list of hinted coordinates. This is something your OS can do for you (following code uses the Windows APIs).

    2. Walk all coordinates and translate the curves into lines (see code sniplet below):

      procedure TGlyphEvaluator.EvaluateFromBuffer( Action: TGlyphEvaluatorAction );
      var
          H                                   : TTPOLYGONHEADER;
          C                                   : TTPOLYCURVE;
          Points                              : array of TPointFX;
          P, PE                               : DWORD;
          i, j                                : Integer;
          F                                   : Double;
          PA, PB, PC                          : TPoint;
      begin
          SetLength( Points, 10 );
          P := 0;
          repeat
              // Eat the polygon header
              Move( FBuffer[ P ], H, sizeof( H ) );
              if H.dwType <> TT_POLYGON_TYPE then Break;          // Sanity check!
              PE := P + H.cb;
              Inc( P, sizeof( H ) );
              Points[ 0 ] := H.pfxStart;
              // Eat all the curve records
              while P < PE do begin
                  // Get the curve record
                  Move( FBuffer[ P ], C, sizeof( C ) - sizeof( TPointFX ) );
                  Inc( P, sizeof( C ) - sizeof( TPointFX ) );
      
                  // Get the points from the curve record
                  if Length( Points ) < C.cpfx + 1 then Setlength( Points, C.cpfx + 1 );
                  Move( FBuffer[ P ], Points[ 1 ], sizeof( TPointFX ) * C.cpfx );
                  Inc( P, sizeof( TPointFX ) * C.cpfx );
      
                  case C.wType of
                      TT_PRIM_LINE: begin
                              MoveTo( Action, Points[ 0 ].x.value, Points[ 0 ].y.value );
                              for i := 1 to C.cpfx do
                                  LineTo( Action, Points[ i ].x.value, Points[ i ].y.value );
                          end;
                      TT_PRIM_QSPLINE: begin
                              MoveTo( Action, Points[ 0 ].x.value, Points[ 0 ].y.value );
                              PA.X := Points[ 0 ].x.value;
                              PA.Y := Points[ 0 ].y.value;
                              for i := 1 to C.cpfx - 1 do begin   // DrawQSpline is called C.cpfx - 1 times
                                  PB.X := Points[ i ].x.value;
                                  PB.Y := Points[ i ].y.value;
                                  PC.X := Points[ i + 1 ].x.value;
                                  PC.Y := Points[ i + 1 ].y.value;
                                  if i < C.cpfx - 1 then begin
                                      PC.X := ( PC.X + PB.X ) div 2;
                                      PC.Y := ( PC.Y + PB.Y ) div 2;
                                  end;
                                  for j := 1 to 8 do begin
                                      F := j / 8;
                                      LineTo( Action, Round( ( PA.x - 2 * PB.x + PC.x ) * Sqr( F ) + ( 2 * PB.x - 2 * PA.x ) * F + PA.x ),
                                          Round( ( PA.y - 2 * PB.y + PC.y ) * Sqr( F ) + ( 2 * PB.y - 2 * PA.y ) * F + PA.y ) );
                                  end;
                                  PA := PC;
                              end;
                          end;
                  end;
                  // Update last point.
                  Points[ 0 ] := Points[ C.cpfx ];
              end;
              MoveTo( Action, Points[ 0 ].x.value, Points[ 0 ].y.value );
              LineTo( Action, H.pfxStart.x.value, H.pfxStart.y.value );
          until P >= Longword( Length( FBuffer ) );
      end;
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there is formula for going RGB -> Luminance, but I need given
I am working with SVG graphics to draw Pie Graphs. I am given the
In my game I draw the line using two points. I want to calculate
I can draw my map according to the formula on Drawing Isometric game worlds
Take the following AS3 that will draw a curved line using curveTo() : var
I need to draw a line in my website, actually a curve representing a
A way to draw the curve corresponding to a given function is this: fun1
What formula would I use in a persisted column so that I can add
The formula mentioned in post Google's Leap Second Smear Techinque :Modulating lie over a
2007 formula written with A1 style, how is it possible to convert the A1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.