질문하기질문하기
 

질문Glyphs OriginY meaning

  • 2009년 5월 13일 수요일 오전 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 2009년 5월 13일 수요일 오전 11:08
    •  

모든 응답

  • 2009년 5월 14일 목요일 오전 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
  • 2009년 5월 15일 금요일 오전 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.