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

  • Home
  • SEARCH
  • 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 554675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:44:06+00:00 2026-05-13T11:44:06+00:00

Is there a way in XAML to add padding around individual characters? Preferably before

  • 0

Is there a way in XAML to add padding around individual characters? Preferably before and after the character.

I have a textbox that I would like the input to be spaced out a bit more (so it aligns with a background image). It would be ideal to be able to do something like:

Any ideas how one can accomplish this?

It looks like one can do this in MS-Word (details here), so hopefully that means it is possible in XAML?

  • 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-13T11:44:06+00:00Added an answer on May 13, 2026 at 11:44 am

    Adjusting inter-character spacing is possible in XAML by using the Glyphs class, specifically the Indices property. This is a pretty low-level text API, so you have to specify the font URI (rather than the family name), and you need to calculate all the spacings yourself.

    The following XAML uses Glyph.Indices to apply inter-character spacing:

    <Glyphs UnicodeString="Expanded" Indices=",100;,100;,100;,100;,100;,100;,100"
        FontUri="file://c:/windows/fonts/arial.ttf"
        Fill="Black" FontRenderingEmSize="24" />
    <Glyphs UnicodeString="Normal"
        FontUri="file://c:/windows/fonts/arial.ttf"
        Fill="Black" FontRenderingEmSize="24" />
    <Glyphs UnicodeString="Condensed" Indices=",60;,50;,50;,50;,45;,50;,40;,45"
        FontUri="file://c:/windows/fonts/arial.ttf"
        Fill="Black" FontRenderingEmSize="24" />
    

    As documented here, the Indices property contains a semicolon-delimited list of chr,off pairs. chr is the index of the glyph within the font; if omitted, WPF will use the glyph corresponding to the current character in UnicodeString. off is the spacing between this glyph and the next; 0 displays the two on top of each other, any positive value increases the spacing. The “normal” spacing will depend on the font you’re using; as you can see in the “Condensed” example, I used a different spacing for different pairs of characters to make the output look better.

    Clearly this only applies to static text that you are displaying, and not input being collected from the user (in a TextBox); I don’t know of any way to adjust the inter-character spacing in the “standard” text objects (TextBlock, TextBox, Run, etc.), so perhaps the answer is “No, there is not a way to do this in XAML”.

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

Sidebar

Related Questions

Is there a way to convert HTML into XAML? I noticed that you can
Is there any way to add XAML snippets for XAML editor in Visual Studio
Is there a way in XAML to set a style that will apply to
Is there a way in XAML to determine if the ListBox has data? I
Is there a way to get Xaml details from an assembly?
Is there a way to disable Intellisense in the XAML editor in Visual Studio
Is there a way to do 'using' in XAML i.e. declare a namespace and
Is there any way to make a DataTemplate reference itself just from XAML? In
Is there a way to take a chunk of XML/XAML and load it as
Is there a way to embed a string in XAML, give it and ID

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.