Re: [ft] FreeType Metrics Question

2012-08-07 Thread Grzegorz Rolek
There's no explicit metric for the cap height in a font file. There indeed 
might be such a metric in font editors, but only as a guide for the designer. I 
doubt any rendering engine calculates the cap height from the font because that 
would mean making a lot of assumptions. I actually don't think the value is of 
any use at this level since the process of spacing the line requires only one 
height from the baseline up to set it properly and the ascender value provides 
this already.

If you indeed need a consistent line spacing between different platforms, then 
you probably want to look into the line gap value, i.e. extra whitespace set 
for a particular font, which has redundant entries in the font, each of which 
being used differently by different platforms. For brief explanation of the 
problem see the section on linespacing, page 23, at Dr. Jürgen Willrodt's 
presentation on OpenType spec at 
http://fonttools.org/downloads/TD_2009/OpenType_Status_2009.pdf.


On Aug 4, 2012, at 6:21 PM, Andreas Sandberg wrote:

> I think actually what I need is the ability to retrieve the cap height.  Is 
> something thats possible to retrieve?

On Aug 6, 2012, at 8:35 PM, Andreas Sandberg wrote:

> So, I just need a way to retrieve the cap height from a font if that's 
> possible.  From some of the font editors I've briefly played with, it does 
> seem possible but I cant' find reference to it in the freetype api.



___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] FreeType Metrics Question

2012-08-06 Thread Andreas Sandberg
Hi,

 Thanks for your input, let me give a little more color as to the
problem as maybe it will help.  I'm trying to calculate the position of
some text on a page after parsing this text from an xml format which
contains the position of the text, font, size, etc.  The text is originally
laid out in a WYSIWG type editor however after it's been translated by my
program, the position is slightly off but only for certain fonts when
displayed in a browser.  It appears as though the source program/editor
aligns the text from the top of the glyph or ascent line versus a standard
web browser which appears to be aligning the text by the cap height.  I
would like to be able to compute the difference so I can make some slight
adjustments in my positioning algorithm.  So, I just need a way to retrieve
the cap height from a font if that's possible.  From some of the font
editors I've briefly played with, it does seem possible but I cant' find
reference to it in the freetype api.  Thanks again for any help.

Andreas



On Sat, Aug 4, 2012 at 12:52 PM, Infro  wrote:

>  I find it best, when asking/[being asked] for help, it is best to
> accurately describe the problem, rather than a problem in a solution,
> unless I have a very firm belief that my current solution, is my best
> solution.  I don't know of an answer to your question about the white
> space, but if you are trying to render identical pages across a variety of
> mediums, it is best to just display a picture.  Flash was a great idea in
> solving this problem, but flash pages weren't/aren't search engine
> crawl-able, but neither are images.  Anyhow, I hope this was./[will be]
> helpful.
>
>
> On 8/4/2012 11:21 AM, Andreas Sandberg wrote:
>
> I think actually what I need is the ability to retrieve the cap height.
>  Is something thats possible to retrieve? it doesn't appear as though that
> metric is listed on the tutorial page (unless it's listed as something
> else) and I've tried to read through the api's and can't find any mention
> of it.  I've also searched through the mailing list archives and couldn't
> find any info.  Thanks again for the help and your patience.
>
>  Andreas
>
>
> On Sat, Aug 4, 2012 at 1:14 AM, vern adams wrote:
>
>> You mean you want identical line spacing across different browsers and
>> across different operating systems? And you are not getting that?
>> -v
>>
>> On 4 Aug 2012, at 05:12, Andreas Sandberg 
>> wrote:
>>
>> > Greetings List,
>> >
>> > I'm very new to font rendering and any type of graphics
>> manipulation so I apologize in advance if this question is somewhat
>> juvenile.  I'm developing a web application and noticed that the rendering
>> that is happening for certain fonts in chrome is very different than how
>> some proprietary layout tools are rendering the same font.  This causes an
>> issue for me as I'm trying to get the rendering to be somewhat identical.
>>  I've been trying to use the free type library to pull out some metrics to
>> see if I could figure out what the rendering engines are doing differently
>> and if I could account for this difference.  What I'm seeing is that for
>> some fonts, and for this example specifically Patua-one, there appears to
>> be a lot of white space from the top of the text within a glyph to the top
>> of the bounding box (vertical spae).  In layman's terms, there is a lot of
>> white space in this font and that's the way it's been designed I suppose.
>>  However, it appears some programs will remove this extra space when
>> rendering the font but others dont.  So, I suppose my question boils down
>> to, is there a way to determine how much white space is present and/or are
>> there specific font metrics that specify this?  I've read through the
>> online docs and have played with the api but was unable to find anything.
>>  So my next approach was then to render a character using the gd library
>> and see if I could detect the pixel width based on color.  Unfortunately it
>> looks like the gd library that php is using is removing this padding and
>> therefore my calculations are off.  Appreciate any help in this matter
>>  Thanks very much, here is a simple text drawing of the space I'm trying to
>> describe:
>> >
>> >
>> > A  (space)
>> > |(space)
>> > |(space)
>> > | *
>> > | *
>> > | *
>> > B*
>> >
>> > where b is the baseline, a the accent, and the *'s represent the actual
>> glyph.
>> >
>> >
>> > Andreas
>> >
>>  > ___
>> > Freetype mailing list
>> > [email protected]
>> > https://lists.nongnu.org/mailman/listinfo/freetype
>>
>>
>
>
> ___
> Freetype mailing 
> [email protected]://lists.nongnu.org/mailman/listinfo/freetype
>
>
>
___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] FreeType Metrics Question

2012-08-04 Thread Infro
I find it best, when asking/[being asked] for help, it is best to 
accurately describe the problem, rather than a problem in a solution, 
unless I have a very firm belief that my current solution, is my best 
solution.  I don't know of an answer to your question about the white 
space, but if you are trying to render identical pages across a variety 
of mediums, it is best to just display a picture.  Flash was a great 
idea in solving this problem, but flash pages weren't/aren't search 
engine crawl-able, but neither are images.  Anyhow, I hope this 
was./[will be] helpful.


On 8/4/2012 11:21 AM, Andreas Sandberg wrote:
I think actually what I need is the ability to retrieve the cap 
height.  Is something thats possible to retrieve? it doesn't appear as 
though that metric is listed on the tutorial page (unless it's listed 
as something else) and I've tried to read through the api's and can't 
find any mention of it.  I've also searched through the mailing list 
archives and couldn't find any info.  Thanks again for the help and 
your patience.


Andreas


On Sat, Aug 4, 2012 at 1:14 AM, vern adams > wrote:


You mean you want identical line spacing across different browsers
and across different operating systems? And you are not getting that?
-v

On 4 Aug 2012, at 05:12, Andreas Sandberg mailto:[email protected]>> wrote:

> Greetings List,
>
> I'm very new to font rendering and any type of graphics
manipulation so I apologize in advance if this question is
somewhat juvenile.  I'm developing a web application and noticed
that the rendering that is happening for certain fonts in chrome
is very different than how some proprietary layout tools are
rendering the same font.  This causes an issue for me as I'm
trying to get the rendering to be somewhat identical.  I've been
trying to use the free type library to pull out some metrics to
see if I could figure out what the rendering engines are doing
differently and if I could account for this difference.  What I'm
seeing is that for some fonts, and for this example specifically
Patua-one, there appears to be a lot of white space from the top
of the text within a glyph to the top of the bounding box
(vertical spae).  In layman's terms, there is a lot of white space
in this font and that's the way it's been designed I suppose.
 However, it appears some programs will remove this extra space
when rendering the font but others dont.  So, I suppose my
question boils down to, is there a way to determine how much white
space is present and/or are there specific font metrics that
specify this?  I've read through the online docs and have played
with the api but was unable to find anything.  So my next approach
was then to render a character using the gd library and see if I
could detect the pixel width based on color.  Unfortunately it
looks like the gd library that php is using is removing this
padding and therefore my calculations are off.  Appreciate any
help in this matter  Thanks very much, here is a simple text
drawing of the space I'm trying to describe:
>
>
> A  (space)
> |(space)
> |(space)
> | *
> | *
> | *
> B*
>
> where b is the baseline, a the accent, and the *'s represent the
actual glyph.
>
>
> Andreas
>
> ___
> Freetype mailing list
> [email protected] 
> https://lists.nongnu.org/mailman/listinfo/freetype




___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] FreeType Metrics Question

2012-08-04 Thread Andreas Sandberg
I think actually what I need is the ability to retrieve the cap height.  Is
something thats possible to retrieve? it doesn't appear as though that
metric is listed on the tutorial page (unless it's listed as something
else) and I've tried to read through the api's and can't find any mention
of it.  I've also searched through the mailing list archives and couldn't
find any info.  Thanks again for the help and your patience.

Andreas


On Sat, Aug 4, 2012 at 1:14 AM, vern adams  wrote:

> You mean you want identical line spacing across different browsers and
> across different operating systems? And you are not getting that?
> -v
>
> On 4 Aug 2012, at 05:12, Andreas Sandberg  wrote:
>
> > Greetings List,
> >
> > I'm very new to font rendering and any type of graphics
> manipulation so I apologize in advance if this question is somewhat
> juvenile.  I'm developing a web application and noticed that the rendering
> that is happening for certain fonts in chrome is very different than how
> some proprietary layout tools are rendering the same font.  This causes an
> issue for me as I'm trying to get the rendering to be somewhat identical.
>  I've been trying to use the free type library to pull out some metrics to
> see if I could figure out what the rendering engines are doing differently
> and if I could account for this difference.  What I'm seeing is that for
> some fonts, and for this example specifically Patua-one, there appears to
> be a lot of white space from the top of the text within a glyph to the top
> of the bounding box (vertical spae).  In layman's terms, there is a lot of
> white space in this font and that's the way it's been designed I suppose.
>  However, it appears some programs will remove this extra space when
> rendering the font but others dont.  So, I suppose my question boils down
> to, is there a way to determine how much white space is present and/or are
> there specific font metrics that specify this?  I've read through the
> online docs and have played with the api but was unable to find anything.
>  So my next approach was then to render a character using the gd library
> and see if I could detect the pixel width based on color.  Unfortunately it
> looks like the gd library that php is using is removing this padding and
> therefore my calculations are off.  Appreciate any help in this matter
>  Thanks very much, here is a simple text drawing of the space I'm trying to
> describe:
> >
> >
> > A  (space)
> > |(space)
> > |(space)
> > | *
> > | *
> > | *
> > B*
> >
> > where b is the baseline, a the accent, and the *'s represent the actual
> glyph.
> >
> >
> > Andreas
> >
> > ___
> > Freetype mailing list
> > [email protected]
> > https://lists.nongnu.org/mailman/listinfo/freetype
>
>
___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] FreeType Metrics Question

2012-08-04 Thread vern adams
You mean you want identical line spacing across different browsers and across 
different operating systems? And you are not getting that?
-v

On 4 Aug 2012, at 05:12, Andreas Sandberg  wrote:

> Greetings List,
> 
> I'm very new to font rendering and any type of graphics manipulation 
> so I apologize in advance if this question is somewhat juvenile.  I'm 
> developing a web application and noticed that the rendering that is happening 
> for certain fonts in chrome is very different than how some proprietary 
> layout tools are rendering the same font.  This causes an issue for me as I'm 
> trying to get the rendering to be somewhat identical.  I've been trying to 
> use the free type library to pull out some metrics to see if I could figure 
> out what the rendering engines are doing differently and if I could account 
> for this difference.  What I'm seeing is that for some fonts, and for this 
> example specifically Patua-one, there appears to be a lot of white space from 
> the top of the text within a glyph to the top of the bounding box (vertical 
> spae).  In layman's terms, there is a lot of white space in this font and 
> that's the way it's been designed I suppose.  However, it appears some 
> programs will remove this extra space when rendering the font but others 
> dont.  So, I suppose my question boils down to, is there a way to determine 
> how much white space is present and/or are there specific font metrics that 
> specify this?  I've read through the online docs and have played with the api 
> but was unable to find anything.  So my next approach was then to render a 
> character using the gd library and see if I could detect the pixel width 
> based on color.  Unfortunately it looks like the gd library that php is using 
> is removing this padding and therefore my calculations are off.  Appreciate 
> any help in this matter  Thanks very much, here is a simple text drawing of 
> the space I'm trying to describe:
> 
> 
> A  (space)
> |(space)
> |(space)
> | *
> | *
> | *
> B*
> 
> where b is the baseline, a the accent, and the *'s represent the actual 
> glyph.  
> 
> 
> Andreas
> 
> ___
> Freetype mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/freetype


___
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype