mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

729 lines
19 KiB

  1. Copied from http://freetype.sourceforge.net/freetype2/patches/fontconfig-2.3.2-noftinternals.patch
  2. File names adapted for X.Org 6.9.0
  3. Patch for xc/lib/fontconfig/Imakefile added
  4. --- xc/lib/fontconfig/Imakefile.orig 2005-11-08 07:33:26.000000000 +0100
  5. +++ xc/lib/fontconfig/Imakefile 2006-07-07 17:57:31.000000000 +0200
  6. @@ -49,11 +49,11 @@
  7. REQUIREDLIBS=$(LDPRELIBS) $(FREETYPE2LIB) $(EXPATLIB)
  8. SRCS=fcatomic.c fcblanks.c fccache.c fccfg.c fccharset.c fcdbg.c \
  9. - fcdefault.c fcdir.c fcfreetype.c fcfs.c fcinit.c fclang.c fclist.c \
  10. + fcdefault.c fcdir.c fcfreetype.c fcftglue.c fcfs.c fcinit.c fclang.c fclist.c \
  11. fcmatch.c fcmatrix.c fcname.c fcpat.c fcstr.c fcxml.c
  12. OBJS=fcatomic.o fcblanks.o fccache.o fccfg.o fccharset.o fcdbg.o \
  13. - fcdefault.o fcdir.o fcfreetype.o fcfs.o fcinit.o fclang.o fclist.o \
  14. + fcdefault.o fcdir.o fcfreetype.o fcftglue.o fcfs.o fcinit.o fclang.o fclist.o \
  15. fcmatch.o fcmatrix.o fcname.o fcpat.o fcstr.o fcxml.o
  16. #include <Library.tmpl>
  17. @@ -186,6 +186,7 @@
  18. LinkSourceFile(fcdefault.c,$(FONTCONFIGSRC)/src)
  19. LinkSourceFile(fcdir.c,$(FONTCONFIGSRC)/src)
  20. /* LinkSourceFile(fcfreetype.c,$(FONTCONFIGSRC)/src) - use custom copy for now */
  21. +LinkSourceFile(fcftglue.c,$(FONTCONFIGSRC)/src)
  22. LinkSourceFile(fcfs.c,$(FONTCONFIGSRC)/src)
  23. LinkSourceFile(fcinit.c,$(FONTCONFIGSRC)/src)
  24. LinkSourceFile(fclang.c,$(FONTCONFIGSRC)/src)
  25. diff -urN xc/lib/fontconfig/fcfreetype.c xc/extras/fontconfig/src/fcfreetype.c
  26. --- xc/lib/fontconfig/fcfreetype.c 2005-04-21 14:37:43.000000000 +0200
  27. +++ xc/lib/fontconfig/fcfreetype.c 2005-07-07 13:17:32.224401218 +0200
  28. @@ -50,14 +50,11 @@
  29. #include "fcint.h"
  30. #include <ft2build.h>
  31. #include FT_FREETYPE_H
  32. -#include FT_INTERNAL_OBJECTS_H
  33. #include FT_TRUETYPE_TABLES_H
  34. #include FT_SFNT_NAMES_H
  35. #include FT_TRUETYPE_IDS_H
  36. #include FT_TYPE1_TABLES_H
  37. -#include FT_INTERNAL_STREAM_H
  38. -#include FT_INTERNAL_SFNT_H
  39. -#include FT_INTERNAL_TRUETYPE_TYPES_H
  40. +#include "fcftglue.h"
  41. #if HAVE_FT_GET_X11_FONT_FORMAT
  42. #include FT_XFREE86_H
  43. #endif
  44. @@ -65,8 +62,7 @@
  45. #if HAVE_FT_GET_BDF_PROPERTY
  46. #include FT_BDF_H
  47. #include FT_MODULE_H
  48. -#define HAS_BDF_PROPERTY(f) ((f) && (f)->driver && \
  49. - (f)->driver->root.clazz->get_interface)
  50. +#define HAS_BDF_PROPERTY(f) ((f))
  51. #define MY_Get_BDF_Property(f,n,p) (HAS_BDF_PROPERTY(f) ? \
  52. FT_Get_BDF_Property(f,n,p) : \
  53. FT_Err_Invalid_Argument)
  54. @@ -1559,7 +1555,7 @@
  55. */
  56. if (FcCharSetCount (cs) == 0)
  57. {
  58. - if (!strcmp(FT_MODULE_CLASS(&face->driver->root)->module_name, "pcf"))
  59. + if (!strcmp(FT_Get_X11_Font_Format(face),"PCF"))
  60. goto bail2;
  61. }
  62. @@ -2706,8 +2702,7 @@
  63. static FT_Error
  64. GetScriptTags(FT_Face face, FT_ULong tabletag, FT_ULong **stags, FT_UShort *script_count)
  65. {
  66. - FT_ULong cur_offset, new_offset, base_offset;
  67. - TT_Face tt_face = (TT_Face)face;
  68. + FT_ULong cur_offset, new_offset, base_offset;
  69. FT_Stream stream = face->stream;
  70. FT_Error error;
  71. FT_UShort n, p;
  72. @@ -2716,51 +2711,43 @@
  73. if ( !stream )
  74. return TT_Err_Invalid_Face_Handle;
  75. - if (( error = tt_face->goto_table( tt_face, tabletag, stream, 0 ) ))
  76. + if ( (error = fcft_face_goto_table( face, tabletag, stream )) != 0 )
  77. return error;
  78. - base_offset = FT_STREAM_POS();
  79. + base_offset = FCFT_STREAM_POS();
  80. /* skip version */
  81. - if ( FT_STREAM_SEEK( base_offset + 4L ) || FT_FRAME_ENTER( 2L ) )
  82. - return error;
  83. -
  84. - new_offset = FT_GET_USHORT() + base_offset;
  85. -
  86. - FT_FRAME_EXIT();
  87. -
  88. - cur_offset = FT_STREAM_POS();
  89. -
  90. - if ( FT_STREAM_SEEK( new_offset ) != TT_Err_Ok )
  91. - return error;
  92. -
  93. - base_offset = FT_STREAM_POS();
  94. + if ( FCFT_STREAM_SEEK( base_offset + 4L ) ||
  95. + FCFT_READ_USHORT( new_offset ) )
  96. + return error;
  97. +
  98. + new_offset += base_offset;
  99. + cur_offset = FCFT_STREAM_POS();
  100. - if ( FT_FRAME_ENTER( 2L ) )
  101. + if ( FCFT_STREAM_SEEK( new_offset ) != TT_Err_Ok )
  102. return error;
  103. - *script_count = FT_GET_USHORT();
  104. + base_offset = FCFT_STREAM_POS();
  105. - FT_FRAME_EXIT();
  106. -
  107. - if ( FT_SET_ERROR (FT_MEM_ALLOC_ARRAY( *stags, *script_count, FT_ULong )) )
  108. - return error;
  109. + if ( FCFT_READ_USHORT(*script_count) ||
  110. + FCFT_MEM_ALLOC_ARRAY( *stags, *script_count, FT_ULong ) )
  111. + return error;
  112. p = 0;
  113. for ( n = 0; n < *script_count; n++ )
  114. {
  115. - if ( FT_FRAME_ENTER( 6L ) )
  116. + if ( FCFT_FRAME_ENTER( 6L ) )
  117. goto Fail;
  118. - (*stags)[p] = FT_GET_ULONG();
  119. - new_offset = FT_GET_USHORT() + base_offset;
  120. + (*stags)[p] = FCFT_GET_ULONG();
  121. + new_offset = FCFT_GET_USHORT() + base_offset;
  122. - FT_FRAME_EXIT();
  123. + FCFT_FRAME_EXIT();
  124. - cur_offset = FT_STREAM_POS();
  125. + cur_offset = FCFT_STREAM_POS();
  126. - if ( FT_STREAM_SEEK( new_offset ) )
  127. + if ( FCFT_STREAM_SEEK( new_offset ) )
  128. goto Fail;
  129. if ( error == TT_Err_Ok )
  130. @@ -2768,7 +2755,7 @@
  131. else if ( error != TTO_Err_Empty_Script )
  132. goto Fail;
  133. - (void)FT_STREAM_SEEK( cur_offset );
  134. + (void)FCFT_STREAM_SEEK( cur_offset );
  135. }
  136. if (!p)
  137. @@ -2784,7 +2771,7 @@
  138. Fail:
  139. *script_count = 0;
  140. - FT_FREE( *stags );
  141. + FCFT_FREE( *stags );
  142. return error;
  143. }
  144. @@ -2841,7 +2828,7 @@
  145. if (FcDebug () & FC_DBG_SCANV)
  146. printf("complex features in this font: %s\n", complex);
  147. bail:
  148. - FT_FREE(gsubtags);
  149. - FT_FREE(gpostags);
  150. + FCFT_FREE(gsubtags);
  151. + FCFT_FREE(gpostags);
  152. return complex;
  153. }
  154. diff -urN xc/extras/fontconfig/src/fcftglue.c xc/extras/fontconfig/src/fcftglue.c
  155. --- xc/extras/fontconfig/src/fcftglue.c 1970-01-01 01:00:00.000000000 +0100
  156. +++ xc/extras/fontconfig/src/fcftglue.c 2005-07-07 13:34:48.630254000 +0200
  157. @@ -0,0 +1,380 @@
  158. +#include "fcftglue.h"
  159. +
  160. +/***************************************************************************/
  161. +/***************************************************************************/
  162. +/***** *****/
  163. +/***** *****/
  164. +/***** *****/
  165. +/***************************************************************************/
  166. +/***************************************************************************/
  167. +
  168. +/* only used internall */
  169. +static FT_Pointer
  170. +fcft_qalloc( FT_Memory memory,
  171. + FT_ULong size,
  172. + FT_Error *perror )
  173. +{
  174. + FT_Error error = 0;
  175. + FT_Pointer block = NULL;
  176. +
  177. + if ( size > 0 )
  178. + {
  179. + block = memory->alloc( memory, size );
  180. + if ( !block )
  181. + error = FT_Err_Out_Of_Memory;
  182. + }
  183. +
  184. + *perror = error;
  185. + return block;
  186. +}
  187. +
  188. +#define FCFT_QALLOC(ptr,size) ( (ptr) = fcft_qalloc( memory, (size), &error ), error != 0 )
  189. +
  190. +
  191. +FCFT_APIDEF( FT_Pointer )
  192. +fcft_alloc( FT_Memory memory,
  193. + FT_ULong size,
  194. + FT_Error *perror )
  195. +{
  196. + FT_Error error = 0;
  197. + FT_Pointer block = NULL;
  198. +
  199. + if ( size > 0 )
  200. + {
  201. + block = memory->alloc( memory, size );
  202. + if ( !block )
  203. + error = FT_Err_Out_Of_Memory;
  204. + else
  205. + memset( (char*)block, 0, (size_t)size );
  206. + }
  207. +
  208. + *perror = error;
  209. + return block;
  210. +}
  211. +
  212. +
  213. +FCFT_APIDEF( FT_Pointer )
  214. +fcft_realloc( FT_Memory memory,
  215. + FT_Pointer block,
  216. + FT_ULong old_size,
  217. + FT_ULong new_size,
  218. + FT_Error *perror )
  219. +{
  220. + FT_Pointer block2 = NULL;
  221. + FT_Error error = 0;
  222. +
  223. + if ( block == NULL )
  224. + {
  225. + block2 = fcft_alloc( memory, new_size, &error );
  226. + }
  227. + else if ( new_size <= 0 )
  228. + {
  229. + fcft_free( memory, block );
  230. + }
  231. + else
  232. + {
  233. + block2 = fcft_alloc( memory, new_size, &error );
  234. + if ( !error )
  235. + {
  236. + memcpy( (char*)block2, (const char*)block, (size_t)old_size );
  237. + if ( new_size > old_size )
  238. + memset( (char*)block2 + old_size, 0, (size_t)(new_size - old_size) );
  239. + }
  240. + }
  241. +
  242. + if ( !error )
  243. + block = block2;
  244. +
  245. + *perror = error;
  246. + return block;
  247. +}
  248. +
  249. +
  250. +FCFT_APIDEF( void )
  251. +fcft_free( FT_Memory memory,
  252. + FT_Pointer block )
  253. +{
  254. + if ( block )
  255. + memory->free( memory, block );
  256. +}
  257. +
  258. +
  259. +FCFT_APIDEF( FT_Long )
  260. +fcft_stream_pos( FT_Stream stream )
  261. +{
  262. + return stream->pos;
  263. +}
  264. +
  265. +
  266. +FCFT_APIDEF( FT_Error )
  267. +fcft_stream_seek( FT_Stream stream,
  268. + FT_Long pos )
  269. +{
  270. + FT_Error error = 0;
  271. +
  272. + stream->pos = pos;
  273. + if ( stream->read )
  274. + {
  275. + if ( stream->read( stream, pos, 0, 0 ) )
  276. + error = FT_Err_Invalid_Stream_Operation;
  277. + }
  278. + else if ( pos > stream->size )
  279. + error = FT_Err_Invalid_Stream_Operation;
  280. +
  281. + return error;
  282. +}
  283. +
  284. +
  285. +FCFT_APIDEF( FT_Error )
  286. +fcft_stream_frame_enter( FT_Stream stream,
  287. + FT_ULong count )
  288. +{
  289. + FT_Error error = FT_Err_Ok;
  290. + FT_ULong read_bytes;
  291. +
  292. + if ( stream->read )
  293. + {
  294. + /* allocate the frame in memory */
  295. + FT_Memory memory = stream->memory;
  296. +
  297. +
  298. + if ( FCFT_QALLOC( stream->base, count ) )
  299. + goto Exit;
  300. +
  301. + /* read it */
  302. + read_bytes = stream->read( stream, stream->pos,
  303. + stream->base, count );
  304. + if ( read_bytes < count )
  305. + {
  306. + FCFT_FREE( stream->base );
  307. + error = FT_Err_Invalid_Stream_Operation;
  308. + }
  309. + stream->cursor = stream->base;
  310. + stream->limit = stream->cursor + count;
  311. + stream->pos += read_bytes;
  312. + }
  313. + else
  314. + {
  315. + /* check current and new position */
  316. + if ( stream->pos >= stream->size ||
  317. + stream->pos + count > stream->size )
  318. + {
  319. + error = FT_Err_Invalid_Stream_Operation;
  320. + goto Exit;
  321. + }
  322. +
  323. + /* set cursor */
  324. + stream->cursor = stream->base + stream->pos;
  325. + stream->limit = stream->cursor + count;
  326. + stream->pos += count;
  327. + }
  328. +
  329. +Exit:
  330. + return error;
  331. +}
  332. +
  333. +
  334. +FCFT_APIDEF( void )
  335. +fcft_stream_frame_exit( FT_Stream stream )
  336. +{
  337. + if ( stream->read )
  338. + {
  339. + FT_Memory memory = stream->memory;
  340. +
  341. + FCFT_FREE( stream->base );
  342. + }
  343. + stream->cursor = 0;
  344. + stream->limit = 0;
  345. +}
  346. +
  347. +
  348. +FCFT_APIDEF( FT_Byte )
  349. +fcft_stream_get_byte( FT_Stream stream )
  350. +{
  351. + FT_Byte result = 0;
  352. +
  353. + if ( stream->cursor < stream->limit )
  354. + result = *stream->cursor++;
  355. +
  356. + return result;
  357. +}
  358. +
  359. +
  360. +FCFT_APIDEF( FT_Short )
  361. +fcft_stream_get_short( FT_Stream stream )
  362. +{
  363. + FT_Byte* p;
  364. + FT_Short result = 0;
  365. +
  366. + p = stream->cursor;
  367. + if ( p + 2 <= stream->limit )
  368. + {
  369. + result = (FT_Short)((p[0] << 8) | p[1]);
  370. + stream->cursor = p+2;
  371. + }
  372. + return result;
  373. +}
  374. +
  375. +
  376. +FCFT_APIDEF( FT_Long )
  377. +fcft_stream_get_long( FT_Stream stream )
  378. +{
  379. + FT_Byte* p;
  380. + FT_Long result = 0;
  381. +
  382. + p = stream->cursor;
  383. + if ( p + 4 <= stream->limit )
  384. + {
  385. + result = (FT_Long)(((FT_Long)p[0] << 24) |
  386. + ((FT_Long)p[1] << 16) |
  387. + ((FT_Long)p[2] << 8) |
  388. + p[3] );
  389. + stream->cursor = p+4;
  390. + }
  391. + return result;
  392. +}
  393. +
  394. +
  395. +static FT_Error
  396. +fcft_stream_readp( FT_Stream stream,
  397. + FT_Byte* *pbuffer,
  398. + FT_ULong count )
  399. +{
  400. + FT_Error error = 0;
  401. +
  402. + if ( stream->read )
  403. + {
  404. + FT_ULong read_bytes = stream->read( stream, stream->pos, *pbuffer, count );
  405. +
  406. + if ( read_bytes != count )
  407. + goto Fail;
  408. +
  409. + stream->pos += count;
  410. + }
  411. + else
  412. + {
  413. + if ( stream->pos >= stream->size ||
  414. + stream->pos + count > stream->size )
  415. + goto Fail;
  416. +
  417. + *pbuffer = stream->base + stream->pos;
  418. + stream->pos += count;
  419. + }
  420. +
  421. +Exit:
  422. + return error;
  423. +
  424. +Fail:
  425. + error = FT_Err_Invalid_Stream_Operation;
  426. + goto Exit;
  427. +}
  428. +
  429. +
  430. +FCFT_API( FT_Byte )
  431. +fcft_stream_read_byte( FT_Stream stream,
  432. + FT_Error *perror )
  433. +{
  434. + FT_Byte temp[1], *p = temp, result = 0;
  435. + FT_Error error = fcft_stream_readp( stream, &p, 1 );
  436. +
  437. + if ( !error )
  438. + result = *p;
  439. +
  440. + return error;
  441. +}
  442. +
  443. +FCFT_API( FT_Short )
  444. +fcft_stream_read_short( FT_Stream stream,
  445. + FT_Error *perror )
  446. +{
  447. + FT_Byte temp[2], *p = temp;
  448. + FT_Short result = 0;
  449. + FT_Error error = fcft_stream_readp( stream, &p, 2 );
  450. +
  451. + if ( !error )
  452. + result = (FT_Short)((p[0] << 8) | p[1]);
  453. +
  454. + return error;
  455. +}
  456. +
  457. +FCFT_API( FT_Long )
  458. +fcft_stream_read_long( FT_Stream stream,
  459. + FT_Error *perror )
  460. +{
  461. + FT_Byte temp[4], *p = temp;
  462. + FT_Long result = 0;
  463. + FT_Error error = fcft_stream_readp( stream, &p, 4 );
  464. +
  465. + if ( !error )
  466. + result = (FT_Long)((FT_Long)(p[0] << 24) |
  467. + (FT_Long)(p[1] << 16) |
  468. + (p[2] << 8) |
  469. + p[3] );
  470. +
  471. + return error;
  472. +}
  473. +
  474. +
  475. +FCFT_APIDEF( FT_Error )
  476. +fcft_face_goto_table( FT_Face face,
  477. + FT_ULong the_tag,
  478. + FT_Stream stream )
  479. +{
  480. + FT_Error error;
  481. +
  482. + if ( !FT_IS_SFNT(face) )
  483. + error = FT_Err_Invalid_Face_Handle;
  484. + else
  485. + {
  486. + /* parse the directory table directly, without using
  487. + * FreeType's built-in data structures
  488. + */
  489. + FT_UInt count, nn;
  490. + FT_ULong offset = 0;
  491. +
  492. + if ( face->num_faces > 1 )
  493. + {
  494. + /* deal with TrueType collections */
  495. + FT_ULong offset;
  496. +
  497. + if ( FCFT_STREAM_SEEK( 12 + face->face_index*4 ) ||
  498. + FCFT_READ_ULONG(offset) )
  499. + goto Exit;
  500. + }
  501. +
  502. + if ( FCFT_STREAM_SEEK( offset+4 ) ||
  503. + FCFT_READ_USHORT(count) )
  504. + goto Exit;
  505. +
  506. +
  507. + if ( FCFT_STREAM_SEEK( offset+12 ) ||
  508. + FCFT_FRAME_ENTER( count*16 ) )
  509. + goto Exit;
  510. +
  511. + for ( nn = 0; nn < count; nn++ )
  512. + {
  513. + FT_ULong tag = FCFT_GET_TAG();
  514. + FT_ULong checksum = FCFT_GET_ULONG();
  515. + FT_ULong start = FCFT_GET_ULONG();
  516. + FT_ULong size = FCFT_GET_ULONG();
  517. +
  518. + FT_UNUSED(checksum);
  519. + FT_UNUSED(size);
  520. +
  521. + if ( tag == the_tag )
  522. + {
  523. + error = fcft_stream_seek( stream, offset+start );
  524. + goto FoundIt;
  525. + }
  526. + }
  527. + error = FT_Err_Table_Missing;
  528. +
  529. + FoundIt:
  530. + FCFT_FRAME_EXIT();
  531. + }
  532. +
  533. +Exit:
  534. + return error;
  535. +}
  536. +
  537. +#undef FCFT_QALLOC
  538. diff -urN xc/extras/fontconfig/src/fcftglue.h xc/extras/fontconfig/src/fcftglue.h
  539. --- xc/extras/fontconfig/src/fcftglue.h 1970-01-01 01:00:00.000000000 +0100
  540. +++ xc/extras/fontconfig/src/fcftglue.h 2005-07-07 13:15:43.292717000 +0200
  541. @@ -0,0 +1,135 @@
  542. +/* the following contains code used to prevent FontConfig from
  543. + * abusing FreeType internals. We simply duplicate some of the FreeType
  544. + * functionality using only publicly defined APIs and structures
  545. + */
  546. +#ifndef __FONTCONFIG_FTGLUE_H__
  547. +#define __FONTCONFIG_FTGLUE_H__
  548. +
  549. +#include <ft2build.h>
  550. +#include FT_FREETYPE_H
  551. +
  552. +FT_BEGIN_HEADER
  553. +
  554. +
  555. +/* utility macros */
  556. +#define FCFT_SET_ERR(c) ( (error = (c)) != 0 )
  557. +
  558. +#ifndef FCFT_API
  559. +#define FCFT_API(x) extern x
  560. +#endif
  561. +
  562. +#ifndef FCFT_APIDEF
  563. +#define FCFT_APIDEF(x) x
  564. +#endif
  565. +
  566. +/* stream macros used by the OpenType parser */
  567. +#define FCFT_STREAM_POS() fcft_stream_pos( stream )
  568. +#define FCFT_STREAM_SEEK(pos) FCFT_SET_ERR( fcft_stream_seek( stream, pos ) )
  569. +#define FCFT_FRAME_ENTER(size) FCFT_SET_ERR( fcft_stream_frame_enter( stream, size ) )
  570. +#define FCFT_FRAME_EXIT() fcft_stream_frame_exit( stream )
  571. +
  572. +#define FCFT_GET_BYTE() fcft_stream_get_byte( stream )
  573. +#define FCFT_GET_SHORT() fcft_stream_get_short( stream )
  574. +#define FCFT_GET_LONG() fcft_stream_get_long( stream )
  575. +
  576. +#define FCFT_GET_CHAR() ((FT_Char)FCFT_GET_BYTE())
  577. +#define FCFT_GET_USHORT() ((FT_UShort)FCFT_GET_SHORT())
  578. +#define FCFT_GET_ULONG() ((FT_ULong)FCFT_GET_LONG())
  579. +#define FCFT_GET_TAG() FCFT_GET_ULONG()
  580. +
  581. +#define FCFT_READ_(val,type,suffix) \
  582. + ( (val) = (type) fcft_stream_read_##suffix (stream, &error), error != 0 )
  583. +
  584. +#define FCFT_READ_BYTE(val) FCFT_READ_(val,FT_Byte,byte)
  585. +#define FCFT_READ_SHORT(val) FCFT_READ_(val,FT_Short,short)
  586. +#define FCFT_READ_LONG(val) FCFT_READ_(val,FT_Long,long)
  587. +
  588. +#define FCFT_READ_CHAR(val) FCFT_READ_(val,FT_Char,byte)
  589. +#define FCFT_READ_USHORT(val) FCFT_READ_(val,FT_UShort,short)
  590. +#define FCFT_READ_ULONG(val) FCFT_READ_(val,FT_ULong,long)
  591. +
  592. +
  593. +FCFT_API( FT_Long )
  594. +fcft_stream_pos( FT_Stream stream );
  595. +
  596. +FCFT_API( FT_Error )
  597. +fcft_stream_seek( FT_Stream stream,
  598. + FT_Long pos );
  599. +
  600. +FCFT_API( FT_Error )
  601. +fcft_stream_frame_enter( FT_Stream stream,
  602. + FT_ULong size );
  603. +
  604. +FCFT_API( void )
  605. +fcft_stream_frame_exit( FT_Stream stream );
  606. +
  607. +FCFT_API( FT_Byte )
  608. +fcft_stream_get_byte( FT_Stream stream );
  609. +
  610. +FCFT_API( FT_Short )
  611. +fcft_stream_get_short( FT_Stream stream );
  612. +
  613. +FCFT_API( FT_Long )
  614. +fcft_stream_get_long( FT_Stream stream );
  615. +
  616. +FCFT_API( FT_Byte )
  617. +fcft_stream_read_byte( FT_Stream stream,
  618. + FT_Error *perror );
  619. +
  620. +FCFT_API( FT_Short )
  621. +fcft_stream_read_short( FT_Stream stream,
  622. + FT_Error *perror );
  623. +
  624. +FCFT_API( FT_Long )
  625. +fcft_stream_read_long( FT_Stream stream,
  626. + FT_Error *perror );
  627. +
  628. +FCFT_API( FT_Error )
  629. +fcft_face_goto_table( FT_Face face,
  630. + FT_ULong tag,
  631. + FT_Stream stream );
  632. +
  633. +/* memory macros used by the OpenType parser */
  634. +#define FCFT_MEM_ALLOC(_ptr,_size) \
  635. + ( (_ptr) = fcft_alloc( memory, _size, &error ), error != 0 )
  636. +
  637. +#define FCFT_MEM_REALLOC(_ptr,_oldsz,_newsz) \
  638. + ( (_ptr) = fcft_realloc( memory, (_ptr), (_oldsz), (_newsz), &error ), error != 0 )
  639. +
  640. +#define FCFT_FREE(_ptr) \
  641. + FT_BEGIN_STMNT \
  642. + if ( (_ptr) ) \
  643. + { \
  644. + fcft_free( memory, _ptr ); \
  645. + _ptr = NULL; \
  646. + } \
  647. + FT_END_STMNT
  648. +
  649. +#define FCFT_MEM_ALLOC_ARRAY(_ptr,_count,_type) \
  650. + FCFT_MEM_ALLOC(_ptr,(_count)*sizeof(_type))
  651. +
  652. +#define FCFT_MEM_REALLOC_ARRAY(_ptr,_oldcnt,_newcnt,_type) \
  653. + FCFT_MEM_REALLOC(_ptr,(_oldcnt)*sizeof(_type),(_newcnt)*sizeof(_type))
  654. +
  655. +
  656. +FCFT_API( FT_Pointer )
  657. +fcft_alloc( FT_Memory memory,
  658. + FT_ULong size,
  659. + FT_Error *perror );
  660. +
  661. +FCFT_API( FT_Pointer )
  662. +fcft_realloc( FT_Memory memory,
  663. + FT_Pointer block,
  664. + FT_ULong old_size,
  665. + FT_ULong new_size,
  666. + FT_Error *perror );
  667. +
  668. +FCFT_API( void )
  669. +fcft_free( FT_Memory memory,
  670. + FT_Pointer block );
  671. +
  672. +/* */
  673. +
  674. +FT_END_HEADER
  675. +
  676. +#endif /* __OPENTYPE_FCFT_H__ */
  677. diff -urN xc/extras/fontconfig/src/Makefile.am xc/extras/fontconfig/src/Makefile.am
  678. --- xc/extras/fontconfig/src/Makefile.am 2004-12-05 06:49:20.000000000 +0100
  679. +++ xc/extras/fontconfig/src/Makefile.am 2005-07-07 13:09:15.416637082 +0200
  680. @@ -86,6 +86,7 @@
  681. fcdefault.c \
  682. fcdir.c \
  683. fcfreetype.c \
  684. + fcftglue.c \
  685. fcfs.c \
  686. fcinit.c \
  687. fclang.c \
  688. diff -urN xc/extras/fontconfig/src/Makefile.in xc/extras/fontconfig/src/Makefile.in
  689. --- xc/extras/fontconfig/src/Makefile.in 2005-04-27 21:08:51.000000000 +0200
  690. +++ xc/extras/fontconfig/src/Makefile.in 2005-07-07 13:09:15.417636939 +0200
  691. @@ -228,6 +228,7 @@
  692. fcdefault.c \
  693. fcdir.c \
  694. fcfreetype.c \
  695. + fcftglue.c \
  696. fcfs.c \
  697. fcinit.c \
  698. fclang.c \
  699. @@ -257,7 +258,7 @@
  700. libfontconfig_la_DEPENDENCIES =
  701. am_libfontconfig_la_OBJECTS = fcatomic.lo fcblanks.lo fccache.lo \
  702. fccfg.lo fccharset.lo fcdbg.lo fcdefault.lo fcdir.lo \
  703. - fcfreetype.lo fcfs.lo fcinit.lo fclang.lo fclist.lo fcmatch.lo \
  704. + fcfreetype.lo fcftglue.lo fcfs.lo fcinit.lo fclang.lo fclist.lo fcmatch.lo \
  705. fcmatrix.lo fcname.lo fcpat.lo fcstr.lo fcxml.lo
  706. libfontconfig_la_OBJECTS = $(am_libfontconfig_la_OBJECTS)