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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:56:53+00:00 2026-06-01T20:56:53+00:00

I have three time series that I’m plotting, and I would like to use

  • 0

I have three time series that I’m plotting, and I would like to use the numbers 1, 3, and 5 as the actual shapes that the XYLineAndShapeRenderer use to display the series.

Even if you have no experience using JFreeChart, if I could figure out how to do any of the following, I think I could accomplish my task:

  1. Convert a character / glyph to a java.awt.Shape
  2. Convert a character / glyph to an ImageIcon
  • 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-01T20:56:55+00:00Added an answer on June 1, 2026 at 8:56 pm

    You can obtain glyph outlines using Font.createGlyphVector and GlyphVector.getGlyphOutline.

    The method below retrieves a GlyphVector for the specified String and retrieves their outlines, applying an AffineTransform in the process.

    static Shape[] getGlyphShapes(Font font, String strGlyphs, AffineTransform transform) {
    
        FontRenderContext frc = new FontRenderContext(null, true, true);
        GlyphVector glyphs = font.createGlyphVector(frc, strGlyphs);
    
        int count = glyphs.getNumGlyphs();
        Shape[] shapes = new Shape[count];
        for (int i = 0; i < count; i ++) {
    
            // get transformed glyph shape
            GeneralPath path = (GeneralPath) glyphs.getGlyphOutline(i);
            shapes[i] = path.createTransformedShape(transform);
        }
        return shapes;
    
    }
    

    By default the returned glyph shapes are of font size 1, hence the AffineTransform. An example transform would be:

                AffineTransform transform = new AffineTransform();
                transform.translate(-20, 20);
                transform.scale(40, 40);
    

    Which should roughly center each glyph (which I presume you’ll need) at a font-size of 40. For more accurate centering, you could use GlyphMetrics, obtained through GlyphVector.getGlyphMetric and calculate the exact translation you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this C# class structure that I would like to refactor to use
I have a series of divs that are hidden and I would like to
I have been learning C++ for three months now and in that time created
I have a (C#) genetic program that uses financial time-series data and it's currently
I have some time-series data that I'm fitting a loess curve in ggplot2, as
I have a set of actions that are returning time-series data with-in ranges specifiable
I have an irregular time series ( xts in R ) that I want
I have some XAML like this drawing a scatterplot of a time series (X-Axis:
I have three fields, namely Number1 Number2 Time I am trying to write a
In My application have time consuming process.There fore i try to do that operation

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.