Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Text shape

Text shape

Scheduled Pinned Locked Moved C#
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thepersonof
    wrote on last edited by
    #1

    Hi I'm trying to have my text bounded by a circle, so that it follows its edges. How can I do this? cheers

    S L 2 Replies Last reply
    0
    • T thepersonof

      Hi I'm trying to have my text bounded by a circle, so that it follows its edges. How can I do this? cheers

      S Offline
      S Offline
      Stephan Samuel
      wrote on last edited by
      #2

      There are articles on the Internet (I remember seeing at least one on this site) about that, with code. The case of a circle is relatively easy, mostly a task in converting polar to Cartesian geometry. Break your text into letters and determine the angle for each letter based on the tangent at that point. The hard part isn't making your text fit on a circle, but the leading between letters. If you're using a variable pitch font, how good the text looks is largely about pair kerning between letters. It's about combinations like "oo" and "oi" not having the same spacing. TrueType contains some hinting, so maybe there's some way to tap into that and pull out instructions from there.

      1 Reply Last reply
      0
      • T thepersonof

        Hi I'm trying to have my text bounded by a circle, so that it follows its edges. How can I do this? cheers

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        GraphicsPath will do that for you :)**

        How xacc.ide transforms text to colored words on the screen
        Intel PentuimM (aka Centrino) undervolting

        **

        T 1 Reply Last reply
        0
        • L leppie

          GraphicsPath will do that for you :)**

          How xacc.ide transforms text to colored words on the screen
          Intel PentuimM (aka Centrino) undervolting

          **

          T Offline
          T Offline
          thepersonof
          wrote on last edited by
          #4

          Thank you!! Also how could I have a text "fill" of a circle, instead of the rectangle? Can this be done with graphics path? cheers

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups