@@ -276,7 +276,7 @@ static void PyGlyph_dealloc(PyGlyph *self)
276
276
static PyObject *PyGlyph_get_bbox (PyGlyph *self, void *closure)
277
277
{
278
278
return Py_BuildValue (
279
- " iiii " , self->bbox .xMin , self->bbox .yMin , self->bbox .xMax , self->bbox .yMax );
279
+ " llll " , self->bbox .xMin , self->bbox .yMin , self->bbox .xMax , self->bbox .yMax );
280
280
}
281
281
282
282
static PyTypeObject *PyGlyph_init_type (PyObject *m, PyTypeObject *type)
@@ -1026,7 +1026,7 @@ static PyObject *PyFT2Font_get_sfnt(PyFT2Font *self, PyObject *args, PyObject *k
1026
1026
}
1027
1027
1028
1028
PyObject *key = Py_BuildValue (
1029
- " iiii " , sfnt.platform_id , sfnt.encoding_id , sfnt.language_id , sfnt.name_id );
1029
+ " HHHH " , sfnt.platform_id , sfnt.encoding_id , sfnt.language_id , sfnt.name_id );
1030
1030
if (key == NULL ) {
1031
1031
Py_DECREF (names);
1032
1032
return NULL ;
@@ -1090,7 +1090,7 @@ static PyObject *PyFT2Font_get_ps_font_info(PyFT2Font *self, PyObject *args, PyO
1090
1090
return NULL ;
1091
1091
}
1092
1092
1093
- return Py_BuildValue (" sssssliii " ,
1093
+ return Py_BuildValue (" ssssslbhH " ,
1094
1094
fontinfo.version ? fontinfo.version : " " ,
1095
1095
fontinfo.notice ? fontinfo.notice : " " ,
1096
1096
fontinfo.full_name ? fontinfo.full_name : " " ,
@@ -1135,8 +1135,8 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1135
1135
switch (tag) {
1136
1136
case 0 : {
1137
1137
char head_dict[] =
1138
- " {s:(h,h ), s:(h,h ), s:l, s:l, s:i , s:i ,"
1139
- " s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:i , s:i , s:h, s:h, s:h}" ;
1138
+ " {s:(h,H ), s:(h,H ), s:l, s:l, s:H , s:H ,"
1139
+ " s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:H , s:H , s:h, s:h, s:h}" ;
1140
1140
TT_Header *t = (TT_Header *)table;
1141
1141
return Py_BuildValue (head_dict,
1142
1142
" version" ,
@@ -1150,9 +1150,9 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1150
1150
" magicNumber" ,
1151
1151
t->Magic_Number ,
1152
1152
" flags" ,
1153
- ( unsigned ) t->Flags ,
1153
+ t->Flags ,
1154
1154
" unitsPerEm" ,
1155
- ( unsigned ) t->Units_Per_EM ,
1155
+ t->Units_Per_EM ,
1156
1156
" created" ,
1157
1157
t->Created [0 ],
1158
1158
t->Created [1 ],
@@ -1168,9 +1168,9 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1168
1168
" yMax" ,
1169
1169
t->yMax ,
1170
1170
" macStyle" ,
1171
- ( unsigned ) t->Mac_Style ,
1171
+ t->Mac_Style ,
1172
1172
" lowestRecPPEM" ,
1173
- ( unsigned ) t->Lowest_Rec_PPEM ,
1173
+ t->Lowest_Rec_PPEM ,
1174
1174
" fontDirectionHint" ,
1175
1175
t->Font_Direction ,
1176
1176
" indexToLocFormat" ,
@@ -1180,64 +1180,64 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1180
1180
}
1181
1181
case 1 : {
1182
1182
char maxp_dict[] =
1183
- " {s:(h,h ), s:i , s:i , s:i , s:i , s:i , s:i ,"
1184
- " s:i , s:i , s:i , s:i , s:i , s:i , s:i , s:i }" ;
1183
+ " {s:(h,H ), s:H , s:H , s:H , s:H , s:H , s:H ,"
1184
+ " s:H , s:H , s:H , s:H , s:H , s:H , s:H , s:H }" ;
1185
1185
TT_MaxProfile *t = (TT_MaxProfile *)table;
1186
1186
return Py_BuildValue (maxp_dict,
1187
1187
" version" ,
1188
1188
FIXED_MAJOR (t->version ),
1189
1189
FIXED_MINOR (t->version ),
1190
1190
" numGlyphs" ,
1191
- ( unsigned ) t->numGlyphs ,
1191
+ t->numGlyphs ,
1192
1192
" maxPoints" ,
1193
- ( unsigned ) t->maxPoints ,
1193
+ t->maxPoints ,
1194
1194
" maxContours" ,
1195
- ( unsigned ) t->maxContours ,
1195
+ t->maxContours ,
1196
1196
" maxComponentPoints" ,
1197
- ( unsigned ) t->maxCompositePoints ,
1197
+ t->maxCompositePoints ,
1198
1198
" maxComponentContours" ,
1199
- ( unsigned ) t->maxCompositeContours ,
1199
+ t->maxCompositeContours ,
1200
1200
" maxZones" ,
1201
- ( unsigned ) t->maxZones ,
1201
+ t->maxZones ,
1202
1202
" maxTwilightPoints" ,
1203
- ( unsigned ) t->maxTwilightPoints ,
1203
+ t->maxTwilightPoints ,
1204
1204
" maxStorage" ,
1205
- ( unsigned ) t->maxStorage ,
1205
+ t->maxStorage ,
1206
1206
" maxFunctionDefs" ,
1207
- ( unsigned ) t->maxFunctionDefs ,
1207
+ t->maxFunctionDefs ,
1208
1208
" maxInstructionDefs" ,
1209
- ( unsigned ) t->maxInstructionDefs ,
1209
+ t->maxInstructionDefs ,
1210
1210
" maxStackElements" ,
1211
- ( unsigned ) t->maxStackElements ,
1211
+ t->maxStackElements ,
1212
1212
" maxSizeOfInstructions" ,
1213
- ( unsigned ) t->maxSizeOfInstructions ,
1213
+ t->maxSizeOfInstructions ,
1214
1214
" maxComponentElements" ,
1215
- ( unsigned ) t->maxComponentElements ,
1215
+ t->maxComponentElements ,
1216
1216
" maxComponentDepth" ,
1217
- ( unsigned ) t->maxComponentDepth );
1217
+ t->maxComponentDepth );
1218
1218
}
1219
1219
case 2 : {
1220
1220
#if PY3K
1221
1221
char os_2_dict[] =
1222
- " {s:h , s:h, s:h , s:h , s:h , s:h, s:h, s:h,"
1223
- " s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:y#, s:(llll ),"
1224
- " s:y#, s:h , s:h , s:h }" ;
1222
+ " {s:H , s:h, s:H , s:H , s:H , s:h, s:h, s:h,"
1223
+ " s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:y#, s:(kkkk ),"
1224
+ " s:y#, s:H , s:H , s:H }" ;
1225
1225
#else
1226
1226
char os_2_dict[] =
1227
- " {s:h , s:h, s:h , s:h , s:h , s:h, s:h, s:h,"
1228
- " s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(llll ),"
1229
- " s:s#, s:h , s:h , s:h }" ;
1227
+ " {s:H , s:h, s:H , s:H , s:H , s:h, s:h, s:h,"
1228
+ " s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(kkkk ),"
1229
+ " s:s#, s:H , s:H , s:H }" ;
1230
1230
#endif
1231
1231
TT_OS2 *t = (TT_OS2 *)table;
1232
1232
return Py_BuildValue (os_2_dict,
1233
1233
" version" ,
1234
- ( unsigned ) t->version ,
1234
+ t->version ,
1235
1235
" xAvgCharWidth" ,
1236
1236
t->xAvgCharWidth ,
1237
1237
" usWeightClass" ,
1238
- ( unsigned ) t->usWeightClass ,
1238
+ t->usWeightClass ,
1239
1239
" usWidthClass" ,
1240
- ( unsigned ) t->usWidthClass ,
1240
+ t->usWidthClass ,
1241
1241
" fsType" ,
1242
1242
t->fsType ,
1243
1243
" ySubscriptXSize" ,
@@ -1264,26 +1264,26 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1264
1264
t->sFamilyClass ,
1265
1265
" panose" ,
1266
1266
t->panose ,
1267
- 10 ,
1267
+ Py_ssize_t ( 10 ) ,
1268
1268
" ulCharRange" ,
1269
- ( unsigned long ) t->ulUnicodeRange1 ,
1270
- ( unsigned long ) t->ulUnicodeRange2 ,
1271
- ( unsigned long ) t->ulUnicodeRange3 ,
1272
- ( unsigned long ) t->ulUnicodeRange4 ,
1269
+ t->ulUnicodeRange1 ,
1270
+ t->ulUnicodeRange2 ,
1271
+ t->ulUnicodeRange3 ,
1272
+ t->ulUnicodeRange4 ,
1273
1273
" achVendID" ,
1274
1274
t->achVendID ,
1275
- 4 ,
1275
+ Py_ssize_t ( 4 ) ,
1276
1276
" fsSelection" ,
1277
- ( unsigned ) t->fsSelection ,
1277
+ t->fsSelection ,
1278
1278
" fsFirstCharIndex" ,
1279
- ( unsigned ) t->usFirstCharIndex ,
1279
+ t->usFirstCharIndex ,
1280
1280
" fsLastCharIndex" ,
1281
- ( unsigned ) t->usLastCharIndex );
1281
+ t->usLastCharIndex );
1282
1282
}
1283
1283
case 3 : {
1284
1284
char hhea_dict[] =
1285
- " {s:(h,h ), s:h, s:h, s:h, s:i , s:h, s:h, s:h,"
1286
- " s:h, s:h, s:h, s:h, s:i }" ;
1285
+ " {s:(h,H ), s:h, s:h, s:h, s:H , s:h, s:h, s:h,"
1286
+ " s:h, s:h, s:h, s:h, s:H }" ;
1287
1287
TT_HoriHeader *t = (TT_HoriHeader *)table;
1288
1288
return Py_BuildValue (hhea_dict,
1289
1289
" version" ,
@@ -1296,7 +1296,7 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1296
1296
" lineGap" ,
1297
1297
t->Line_Gap ,
1298
1298
" advanceWidthMax" ,
1299
- ( unsigned ) t->advance_Width_Max ,
1299
+ t->advance_Width_Max ,
1300
1300
" minLeftBearing" ,
1301
1301
t->min_Left_Side_Bearing ,
1302
1302
" minRightBearing" ,
@@ -1312,12 +1312,12 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1312
1312
" metricDataFormat" ,
1313
1313
t->metric_Data_Format ,
1314
1314
" numOfLongHorMetrics" ,
1315
- ( unsigned ) t->number_Of_HMetrics );
1315
+ t->number_Of_HMetrics );
1316
1316
}
1317
1317
case 4 : {
1318
1318
char vhea_dict[] =
1319
- " {s:(h,h ), s:h, s:h, s:h, s:i , s:h, s:h, s:h,"
1320
- " s:h, s:h, s:h, s:h, s:i }" ;
1319
+ " {s:(h,H ), s:h, s:h, s:h, s:H , s:h, s:h, s:h,"
1320
+ " s:h, s:h, s:h, s:h, s:H }" ;
1321
1321
TT_VertHeader *t = (TT_VertHeader *)table;
1322
1322
return Py_BuildValue (vhea_dict,
1323
1323
" version" ,
@@ -1330,7 +1330,7 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1330
1330
" vertTypoLineGap" ,
1331
1331
t->Line_Gap ,
1332
1332
" advanceHeightMax" ,
1333
- ( unsigned ) t->advance_Height_Max ,
1333
+ t->advance_Height_Max ,
1334
1334
" minTopSideBearing" ,
1335
1335
t->min_Top_Side_Bearing ,
1336
1336
" minBottomSizeBearing" ,
@@ -1346,10 +1346,10 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1346
1346
" metricDataFormat" ,
1347
1347
t->metric_Data_Format ,
1348
1348
" numOfLongVerMetrics" ,
1349
- ( unsigned ) t->number_Of_VMetrics );
1349
+ t->number_Of_VMetrics );
1350
1350
}
1351
1351
case 5 : {
1352
- char post_dict[] = " {s:(h,h ), s:(h,h ), s:h, s:h, s:k, s:k, s:k, s:k, s:k}" ;
1352
+ char post_dict[] = " {s:(h,H ), s:(h,H ), s:h, s:h, s:k, s:k, s:k, s:k, s:k}" ;
1353
1353
TT_Postscript *t = (TT_Postscript *)table;
1354
1354
return Py_BuildValue (post_dict,
1355
1355
" format" ,
@@ -1376,12 +1376,12 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1376
1376
case 6 : {
1377
1377
#if PY3K
1378
1378
char pclt_dict[] =
1379
- " {s:(h,h ), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:y, s:y, s:b , s:b, "
1380
- " s:b}" ;
1379
+ " {s:(h,H ), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:y# , s:y# , s:b, "
1380
+ " s:b, s:b }" ;
1381
1381
#else
1382
1382
char pclt_dict[] =
1383
- " {s:(h,h ), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:s, s:s, s:b , s:b, "
1384
- " s:b}" ;
1383
+ " {s:(h,H ), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:s# , s:s# , s:b, "
1384
+ " s:b, s:b }" ;
1385
1385
#endif
1386
1386
TT_PCLT *t = (TT_PCLT *)table;
1387
1387
return Py_BuildValue (pclt_dict,
@@ -1404,8 +1404,10 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
1404
1404
t->SymbolSet ,
1405
1405
" typeFace" ,
1406
1406
t->TypeFace ,
1407
+ Py_ssize_t (16 ),
1407
1408
" characterComplement" ,
1408
1409
t->CharacterComplement ,
1410
+ Py_ssize_t (8 ),
1409
1411
" strokeWeight" ,
1410
1412
t->StrokeWeight ,
1411
1413
" widthType" ,
@@ -1528,7 +1530,8 @@ static PyObject *PyFT2Font_get_bbox(PyFT2Font *self, void *closure)
1528
1530
{
1529
1531
FT_BBox *bbox = &(self->x ->get_face ()->bbox );
1530
1532
1531
- return Py_BuildValue (" iiii" , bbox->xMin , bbox->yMin , bbox->xMax , bbox->yMax );
1533
+ return Py_BuildValue (" llll" ,
1534
+ bbox->xMin , bbox->yMin , bbox->xMax , bbox->yMax );
1532
1535
}
1533
1536
1534
1537
static PyObject *PyFT2Font_ascender (PyFT2Font *self, void *closure)
0 commit comments