~ubuntu-branches/ubuntu/gutsy/icu/gutsy

« back to all changes in this revision

Viewing changes to source/samples/layout/GnomeFontInstance.cpp

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2005-05-21 22:44:31 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: package-import@ubuntu.com-20050521224431-r7rktfhnu1n4tf1g
Tags: 2.1-2.1
Rename icu-doc to icu21-doc. icu-doc is built by the icu28 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
    // FIXME: what about the display resolution?
48
48
    // TT_Set_Instance_Resolutions(fInstance, 72, 72);
 
49
    fDeviceScaleX = ((float) 96) / 72;
 
50
    fDeviceScaleY = ((float) 96) / 72;
 
51
 
49
52
    TT_Set_Instance_CharSize(fInstance, pointSize << 6);
50
53
 
51
54
    TT_Get_Face_Properties(fFace, &faceProperties);
52
55
 
53
56
    fUnitsPerEM = faceProperties.header->Units_Per_EM;
54
57
 
55
 
    fAscent  = (le_int32) yUnitsToPoints(faceProperties.horizontal->Ascender);
56
 
    fDescent = (le_int32) -yUnitsToPoints(faceProperties.horizontal->Descender);
57
 
    fLeading = (le_int32) yUnitsToPoints(faceProperties.horizontal->Line_Gap);
 
58
    fAscent  = (le_int32) (yUnitsToPoints(faceProperties.horizontal->Ascender) * fDeviceScaleY);
 
59
    fDescent = (le_int32) -(yUnitsToPoints(faceProperties.horizontal->Descender) * fDeviceScaleY);
 
60
    fLeading = (le_int32) (yUnitsToPoints(faceProperties.horizontal->Line_Gap) * fDeviceScaleY);
58
61
 
59
62
    // printf("Face = %s, unitsPerEM = %d, ascent = %d, descent = %d\n", fontPathName, fUnitsPerEM, fAscent, fDescent);
60
63