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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:35:38+00:00 2026-06-14T14:35:38+00:00

I have two text labels in a SVG graph: <svg width=960 height=500><g transform=translate(20,20)> <text

  • 0

I have two text labels in a SVG graph:

<svg width="960" height="500"><g transform="translate(20,20)">
    <text class="title" dx="0px" dy="39px">1980-2012</text>
    <text class="cantontitle" dx="0px" dy="78px">Graubünden</text>
</svg>​

I use the following CSS styles:

svg {                                                                                       
    font: 10px sans-serif;                                                                  
}                                                                                           

.title {                                                                                    
    font: 300 78px Helvetica Neue;                                                          
    fill: #666;                                                                             
}                                                                                           

.cantontitle {                                                                              
    font: 300 40px Helvetica Neue;                                                                                                     
    fill: #666;                                                                             
}                                                                                          ​

Unfortunately, the characters aren’t properly left-aligned.

Screenshot

Is it possible to properly left-align the first characters of two <text> elements?

Here’s a jsfiddle for easier testing: http://jsfiddle.net/UMnnP/1/

  • 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-14T14:35:39+00:00Added an answer on June 14, 2026 at 2:35 pm

    The text is left aligned. The offset is caused by the metrics of the glyphs in the font. In difference to a simple path a glyph has additional metrics definitions, which define the rectangle it »lives« in. The left end of this rectangle is independent from the left end of the glyph’s graphics, it can have an negative and positive offset. Additionally to the font-metric, kerning is added to special pairs of glyphs.

    To align the glyphs totally accurate to the left you need to convert the text into paths, or you can try to get the offset by checking the metrics of the glyph, what is easily possible if you have the font in svg format. But all in all, this can become very tedious and a little handwritten offset to correct that can save you from hours of coding, but if you really need it I strongly recommend to get in touch with fonts and their metrics.

    Greetings…

    EDIT:

    your css does not work! I just saw it too late…

    it must be:

    font-family : Helvetica Neue
    

    instead of

    font : Helvetica Neue
    

    With this it is quite more left aligned…

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

Sidebar

Related Questions

I have a listview with two labels, title and subtitle. I want to have
I have two labels: <asp:Label ID=Label1 runat=server Text=Label></asp:Label> <asp:Label ID=Label2 runat=server Text=Label></asp:Label> and I
In my application, I have two text boxes accompanied with two labels: Connected and
supposing that I have two labels with variables text. For example: label1.Text = foo;
I have Six labels, I want to hide two label's text randomly when a
I have two text files in two different languages and they are aligned line
I have two text-boxes which are used to select a From and a To
I have two text files. hash_only.txt and final_output.txt hash_only.txt looks like below. 193548 401125
I have two text files with various columns, each column is separated by a
I have two text file. file1.txt has: gedit google chrome git vim foo bar

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.