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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:50:11+00:00 2026-05-28T01:50:11+00:00

Currently, if I have a <TextBlock> element with font size 200, the entire element

  • 0

Currently, if I have a <TextBlock> element with font size 200, the entire element takes up much more space than needed.

Wasted Space

The blue outline (from Blend) shows the space the element takes up, when easily half of that is needed. Is there anyway I can eliminate that space such that my elements are not spaced out so much? I’ve tried margin, padding etc but most methods don’t seem to work.

Ideal

Ideally I would want the <textblock> to take up only the amount of space indicated by the red box

Edit:

With Lower Cased Letters

In response to stijn7, some space is indeed reserved for other letters (g,p,q etc). However there still is a lot of space at the top (1 is the highest character in Segoe UI). If clipping the textblock is not possible, is there anyway I can resize it such that there is no wasted space?

  • 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-28T01:50:12+00:00Added an answer on May 28, 2026 at 1:50 am

    The problem here is that the TextBlock has the height incorporates the ascender and descender on order to render characters with a range of heights. The character you have chosen happens to span the font x-height, but not beyond. In order to achieve the effect you are after you will need a slightly lower level text rendering API, I would suggest trying the FormattedText class:

    Provides low-level control for drawing text in Windows Presentation
    Foundation (WPF) applications.

    This class has a MaxTextHeight property. I have not tried this, but there is a chance it will give you the information you require.

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

Sidebar

Related Questions

currently I have this in my XAML: <phone:PhoneApplicationPage.Resources> <toolkit:RelativeTimeConverter x:Key=RelativeTimeConverter/> </phone:PhoneApplicationPage.Resources> .... <TextBlock x:Name=txtTimeAdded
Unknown attribute Foreground on element TextBlock I have this error, when I'm trying to
currently i have a textblock placed in a scroll viewer control. How do i
Currently have a drop down menu that is activated on a hover (from display:none
Currently have password protection on my main and sub directories, however I'd like to
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
I currently have a table of concentrations, which are linked to a table of
I currently have one project that currently contains multiple packages. These packages make up
I currently have 4 tables. Product, Category, SubCategory, ProductSubCategory. Category has a OneToMany SubCategory
I currently have a form with inputs and name attributes. I'm able to get

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.