Joren
Topic Author
Posts: 14
Joined: 12 Nov 2019, 15:33

Support for BaseAlignment for Inline elements

11 May 2020, 14:46

Hey,

Is there any support planned for BaseAlignment for Inline elements? (https://docs.microsoft.com/en-us/dotnet ... etcore-3.1)

We have a system in place that parses text and inserts icons and styling elements into the text. For icons inside a textblock, we use an InlineUIContainer with an image inside. However we have no control over how this image is positioned vertically. The default seems to follow the BaseLine, which doesn't look correct, especially when using different fonts. In our case Center or even Bottom would be the best case for us.

Attached an image that shows various values for BaseAlignment. Test Xaml below that mimics the output of the textparser (and is used in the image).
<StackPanel Orientation="Vertical" Background="DarkGray">
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Top"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Center"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Bottom"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Baseline"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="TextTop"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="TextBottom"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Subscript"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
  <TextBlock>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
      <InlineUIContainer BaselineAlignment="Superscript"><Rectangle Fill="Orange" Width="20" Height="20"/></InlineUIContainer>
      <Span FontSize="20">
        <Run Text="test test"/>
     </Span>
  </TextBlock>
</StackPanel>
So yeah, is this something that is on the planning?
Attachments
BaseAlignmentComparison.png
Preview
BaseAlignmentComparison.png (23.2 KiB) Viewed 173 times
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Support for BaseAlignment for Inline elements

12 May 2020, 01:39

Hi, thanks for the detailed information. Could you please create a ticket about this feature? We should have this implemented.
 
Joren
Topic Author
Posts: 14
Joined: 12 Nov 2019, 15:33

Re: Support for BaseAlignment for Inline elements

12 May 2020, 11:38

Thanks for your reply! Looking forward to this feature! Created #0001684
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Support for BaseAlignment for Inline elements

12 May 2020, 12:49

Thanks for reporting!

Who is online

Users browsing this forum: No registered users and 0 guests