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 8477183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:23:24+00:00 2026-06-10T18:23:24+00:00

Here is what I’m trying to do. I have a font that is basically

  • 0

Here is what I’m trying to do. I have a font that is basically bitmap rectangles for each glyph. I’m trying to get arced text effect like this:

enter image description here

My plan is, given a center and a radius, I’m going to solve for the position and angle of each glyph.

I have a function that can find the position:

Vec2 Math::positionFromCenterToLineAt( Vec2 center, float dist,
        float totalAngular, float angularDistance, float angularOffset )
    {
        float startAngle = -((totalAngular) / 2.0f);
        float curAngle = startAngle + angularDistance;
        curAngle -= angularOffset;
        curAngle += angularDistance / 2.0f;
        curAngle += CGE_PI;

        Vec2 retVec = center;
        Vec2 angVec = Vec2(sin(curAngle),cos(curAngle));
        angVec *= dist;
        retVec += angVec;

        return retVec;
    }

It requires me to know how much of the circle will be occupied in radians, and requires how many degrees from the start angle the current glyph should be drawn at.

What I cannot figure out is a function to find the angle a given glyph will occupy given the radius, center, and width and height of the glyph. Each glyph can have a different dimension.

See this:
enter image description here

As you can see, I’m looking for in radians, that sector of the circle.

How could I calculate it?

Thanks

  • 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-06-10T18:23:26+00:00Added an answer on June 10, 2026 at 6:23 pm
    2*pi*radius equals the circumference
    You know radius as a pixel base(lets say it is 40 pixels)
    You can find circumference(lets say it is 251 pixels)
    Then, if you get width of a char(lets say it is 8)
    You know the angle of arc: angle=2*pi*(8/251)=2*pi*0.03=0.2 radians
    0.2 radians * 57.3 = 11.5 degrees
    

    How to find width of a char according to current font?

    LOGFONT lf;
    int width=lf.lfWidth; //beware! this is average
    

    You want precise option?

    GetTextExtentPoint32() // search usage of this!
    
    Its structure type is:
    
     BOOL GetTextExtentPoint32(
      __in   HDC hdc,
      __in   LPCTSTR lpString,
      __in   int c,
      __out  LPSIZE lpSize
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Basically, what I'm trying to create is a page of div tags, each has
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is my code (Say we have a single button on the page that
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is what I am trying to achieve in PHP: I have this string:
Here is my scenario. I have a website running under AppPool1 and that works

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.