LineSpacing + Text Selection

5 posts, 1 answers
  1. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 07 Mar 2013 Link to this post

    Hello Telerik!

    I did find in the formus similar problems, but i didnt find the solution i needed.
    If I do this, to make line spacing look like in a microsoft notepad, i get problems with changing font size after that.

    private void xamlDP_SetupDocument(object sender, Telerik.Windows.Documents.FormatProviders.SetupDocumentEventArgs e)
    {
        e.Document.LineSpacing = 0.3;
    }

    Selection looks like on "screenshot.png".


    How can I fix that?
  2. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 08 Mar 2013 Link to this post

    Also, automatic line wrapping works not right anymore (see screenshot2.png)

    Are there other settings to make line spacing in all cases the same (0.3) ?
  3. DevCraft banner
  4. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 11 Mar 2013 Link to this post

    Dear Telerik,

    Please provide me some information about this... I have a feeling that my posts are often ignored by your support...
  5. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 11 Mar 2013 Link to this post

    Hi Oleg,

    We try to monitor the forums, but an answer is by no means guaranteed. If you or your company has purchased a license for RadControls for Silverlight, you can refer to our FAQ section for information on how to get assigned as a license holder and use the support ticketing system.

    As for your question, the line spacing is a parameter that specifies the spacing between lines in the same paragraph. Setting LineSpacing = 1 and LineSpacingType = Multiple (the default value) specifies that the line will be as high as 1 * the maximum word height in the line. That is why if you set it to a value less than 1, this will cause text to overlap and the selection will not show correctly.

    If you want to set an exact value, say 15 pt, to be the line spacing, you could do so as follows:

    e.Document.LineSpacingType = LineSpacingType.Exact;
    e.Document.LineSpacing = Unit.PointToDip(15);

    Again, if the height of the line is larger than 15 pt, the text will overlap.

    Perhaps the property you are looking for is ParagraphDefaultSpacingAfter, which has a default value of 9pt and is the space between adjacent paragraphs? This one can be set to 0 and will simply cause no spacing between paragraphs.

    All the best,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 11 Mar 2013 Link to this post

    Thank you very much, that was exactly what i needed... and sorry for the "tone" :)

    I will contact my "license holder" :)
Back to Top
DevCraft banner