MSDN > 論壇首頁 > XML Paper Specification (XPS) > Glyphs OriginY meaning
發問發問
 

問題Glyphs OriginY meaning

  • Wednesday, 13 May, 2009 11:08Ilmslb 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hello,

    I am trying to figure out how to find the precise coordinates of the bounding rectangle of a Glyphs object.
    In Silverlight, I am trying to display a rectangle around a Glyphs object. The XAML is from a XPS generated with Microsoft XPS Document Writer

    OriginY does not seem to be the top nor bottom of text rectangle.
    OriginX however is OK.
    If I draw a horizontal line at the OriginY it seems that it's right at the bottom of the letters like 'a','b','c' which is fine but not for a character like 'y'. For character 'y' the line is crossing it in the middle.

    There is no RenderTransform specified so that's not the problem.

    For instance, I generated a XPS from a Word document with no margins. Looking in the generated XPS i see that OriginY for the Glyphs has a non zero value.

    Can anybody give a hint about how that coordinate is generated?


    Thanks.
    • 已編輯Ilmslb Wednesday, 13 May, 2009 11:08
    •  

所有回覆

  • Thursday, 14 May, 2009 8:16nixps 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi,

    It's the location of the Glyph's baseline: http://en.wikipedia.org/wiki/Baseline_(typography)

    Section 5.1.1 in the XPS 1.0 spec has a nice picture explaining this.

    Regards,
    Nick.

    Check out my cross platform xps library and tools at http://nixps.com
  • Friday, 15 May, 2009 9:28Ilmslb 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi nixps,

    Thanks alot for your answer.

    I suppose finding the bounding box implies parsing the actual font file and use the metrics of the font.

    What I mean is thereisn't any way to aproximate it just with the Glyphs attributes, correct?

    Thanks.