locked
Line Height RRS feed

  • Question

  • Hello Everyone,
    Started developing my first Silverlight application and for the life of me, cannot adjust the Line Height from the Text / Paragraph pane. At first I thought it was due to a non-standard font, then because it not dynamic but then I tried a web standard font like verdana but still, I cannot adjust the line height.

    I tried searching for an answer and have not found one. All i've found is "line height is based on the font" but nothing on changing this setting. Can I assume that this cannot be done yet?

    On a seperate note but sticking to my line height issue, how the hell can I get my drawings from Design into Blend? What I did was, create my text in Illustrator with the proper line height, copyy it into Design to produce the XAML but then I got stuck. I could not properly import / copy / write XAML to my application; everytime, the paths were created for each letter but they ended up in the middle of the stage; all of the letters?

    Thanks.
    Saturday, November 22, 2008 1:21 AM

Answers

  • Hi sophistikat,

    May I know what control are you using to display the text? Whether its a TextBlock or TextBox, all you need to do is set the height property to Auto in order to let it scale according to your font size.

    Exporting your graphical assets from Expression Design to Expression Blend is just a simple copy paste, but remember to tweak your clipboard settings to store either WPF or Silverlight XAML, which is pretty different (WPF is the superset, Silverlight is the subset).

    As for letters, all characters you write in Expression Design might be converted into paths in Expression Blend, I have not tested this out. You should just use a TextBlock to display any text. If you want to use non-standard fonts, just embed the fonts and that'll do.

    If this answered your question, please mark as answered for reference to those facing similar issues.

    -
    Monday, November 24, 2008 6:39 AM

All replies

  • Hi sophistikat,

    May I know what control are you using to display the text? Whether its a TextBlock or TextBox, all you need to do is set the height property to Auto in order to let it scale according to your font size.

    Exporting your graphical assets from Expression Design to Expression Blend is just a simple copy paste, but remember to tweak your clipboard settings to store either WPF or Silverlight XAML, which is pretty different (WPF is the superset, Silverlight is the subset).

    As for letters, all characters you write in Expression Design might be converted into paths in Expression Blend, I have not tested this out. You should just use a TextBlock to display any text. If you want to use non-standard fonts, just embed the fonts and that'll do.

    If this answered your question, please mark as answered for reference to those facing similar issues.

    -
    Monday, November 24, 2008 6:39 AM
  • Hi KokChiann,

    They are TextBlocks, the heights are set to Auto and I've embed the font i needed. Here's the XAML of one of the fields, if helps. I had a screenshot for you but this site doesn't let you post an image / or i can't see the option. Let me know if you need something else from me.


    &lt;TextBlock HorizontalAlignment="Left" Margin="24,149,0,144" Width="244" Text="My holiday wish is that we all live in peaceful global village" TextWrapping="Wrap" Foreground="#FFFFFFFF" FontFamily="./Fonts/Fonts.zip#Promised Freedom" d:IsStaticText="True" FontSize="36" TextAlignment="Center" RenderTransformOrigin="0.5,0.5" x:Name="copy_en" Visibility="Collapsed" &gt;<br>  


    Monday, November 24, 2008 6:51 PM
  • Yo,

    May I know the parent container of this TextBlock? Is it a Grid or Canvas? I would recommend setting the margins to zero other than the values that are used to position your Textblock.

    e.g.: If the TextBlock is in a grid, with HorizontalAlignment = Left and Vertical Alightment = Top, set only the Top and Left margins, with the right and bottom margins set to zero.

    Please let me know if this solves your problem, if it still doesn't work, could you please take a screenshot and upload via some picture hosting service (like imageshack or photobucket) and drop a link here so I could see how it looks like

    -
    Tuesday, November 25, 2008 8:39 AM
  • Hey,

    The parent is a Grid. I set the alignments to LT and set 0s to Right & Bottom but still can't.
    The file is called line-height-screen-grab; http://www.upload4free.com/download.php?file=1140850961-line-height-screen-grab.jpg

    Let me ask you this. Using Blend 2, creating a Silverlight 2 project, can you create a textbox and adjust the line height?
    Friday, November 28, 2008 7:17 PM