[poppler] Read some more info from the Font Descriptor

Albert Astals Cid aacid at kde.org
Sun Jul 3 11:49:01 PDT 2005


Ok, so the master wants ints for those both attributes, i assume you want m=
e=20
to store 100, 200, 300, 400, 500, 600, 700, 800 and 900 for FontWeight but=
=20
which values should i give to FontStretch?

Albert

A Dimecres 29 Juny 2005 23:03, v=C3=A0reu escriure:
> Albert Astals Cid wrote:
> > Well i disagree with the integers thing, mostly because which integers
> > choose? 1, 2, 3, 4, ..? That is the same as an enum, the other possibli=
ty
> > is using the same integers fontconfig uses, that has two different
> > problems:
> >
> >  -  First, we have to either include fontconfig.h in this file to be ab=
le
> > of doing the assignment or copy the numbers at hand. Including fontconf=
ig
> > just for this does not seem right as this class as nothing to do with
> > fontconig, in the other side copying the numbers by hand is just plain
> > wrong.
> >
> >  - Second, there is not a 1 to 1 match between the values that fontconf=
ig
> > has and the values the pdf spec has, we have to choose the corresponden=
ce
> > somewhere but again this file does not seem the right place to do that.
>
> Right, I don't think we should include fontconfig.h or convert the PDF
> values to fontconfig values.  But for the font weight, I think it's
> pretty natural to just store the integer that the font descriptor
> specifies as an integer.  When we want to use that with fontconfig it's
> easy to just map the PDF value to a fontconfig value by scaling it:
>
> 	int fc_weight =3D (pdf_weight - 100) * FC_WEIGHT_BLACK / 800;
>
> Similarly, storing the stretch as an integer between 0-8 allows us to
> map that to a fontconfig stretch value in a similar way.
>
> Kristian

		
______________________________________________ 
Renovamos el Correo Yahoo! 
Nuevos servicios, más seguridad 
http://correo.yahoo.es


More information about the poppler mailing list