locked
Subscript and superscript custom text/symbol?

    Question

  • Is there a way to create custom symbols into text? I'm thinking something like a custom farenheit symbol as either a PNG or else a custom fraction like f/10.0.  Preferably I would like a way to do it programatically like:

    "&SUPERF/10.0" and just parse &SUPERF into a superscript letter. I tried using typography.variants="superscript" but it only accepts numbers and not letters. And if I wanted something really esoteric like a custom farenheit degree symbol it would require an inline png. 

    My current only solution is a dynamically generated StackPanel with orientation as horizontal.  But that seems like quite the hack for something a really rich text box should support.  A simple baseline font property would go a really long way or a straight up vertical transform option on <Run> tags. 
    Tuesday, March 31, 2015 8:03 AM

Answers

  • Hi im.thatoneguy,

    It should related with the RichTextBlock font family, if I using default or something like "Segoe UI", I was not able to see any superscript or subscript.

    If I use "Palatino Linotype", then it works fine.

            <RichTextBlock FontFamily="Palatino Linotype">
                <Paragraph FontSize="50">
                    <Run Typography.Variants="Subscript">SUPERF</Run>
                    <Run >/10.0</Run>
                    14
                    <Run Typography.Variants="Superscript">th</Run>
                </Paragraph>
    
            </RichTextBlock>

    Some screenshot preview:

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 01, 2015 5:17 AM
    Moderator

All replies

  • Hi im.thatoneguy,

    It should related with the RichTextBlock font family, if I using default or something like "Segoe UI", I was not able to see any superscript or subscript.

    If I use "Palatino Linotype", then it works fine.

            <RichTextBlock FontFamily="Palatino Linotype">
                <Paragraph FontSize="50">
                    <Run Typography.Variants="Subscript">SUPERF</Run>
                    <Run >/10.0</Run>
                    14
                    <Run Typography.Variants="Superscript">th</Run>
                </Paragraph>
    
            </RichTextBlock>

    Some screenshot preview:

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 01, 2015 5:17 AM
    Moderator
  • Strange. So it's just missing from the Segoe family.  Unfortunately then since I want to stick to standard Windows design specs I'm going to have to go with my StackPanel generator or textblocks. 
    Friday, April 03, 2015 2:55 PM