freetype.h 244 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993
  1. /***************************************************************************/
  2. /* */
  3. /* freetype.h */
  4. /* */
  5. /* FreeType high-level API and common types (specification only). */
  6. /* */
  7. /* Copyright 1996-2013 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. #ifndef __FREETYPE_H__
  18. #define __FREETYPE_H__
  19. #ifndef FT_FREETYPE_H
  20. #error "`ft2build.h' hasn't been included yet!"
  21. #error "Please always use macros to include FreeType header files."
  22. #error "Example:"
  23. #error " #include <ft2build.h>"
  24. #error " #include FT_FREETYPE_H"
  25. #endif
  26. #include <ft2build.h>
  27. #include FT_CONFIG_CONFIG_H
  28. #include FT_TYPES_H
  29. #include FT_ERRORS_H
  30. FT_BEGIN_HEADER
  31. /*************************************************************************/
  32. /* */
  33. /* <Section> */
  34. /* user_allocation */
  35. /* */
  36. /* <Title> */
  37. /* User allocation */
  38. /* */
  39. /* <Abstract> */
  40. /* How client applications should allocate FreeType data structures. */
  41. /* */
  42. /* <Description> */
  43. /* FreeType assumes that structures allocated by the user and passed */
  44. /* as arguments are zeroed out except for the actual data. In other */
  45. /* words, it is recommended to use `calloc' (or variants of it) */
  46. /* instead of `malloc' for allocation. */
  47. /* */
  48. /*************************************************************************/
  49. /*************************************************************************/
  50. /*************************************************************************/
  51. /* */
  52. /* B A S I C T Y P E S */
  53. /* */
  54. /*************************************************************************/
  55. /*************************************************************************/
  56. /*************************************************************************/
  57. /* */
  58. /* <Section> */
  59. /* base_interface */
  60. /* */
  61. /* <Title> */
  62. /* Base Interface */
  63. /* */
  64. /* <Abstract> */
  65. /* The FreeType~2 base font interface. */
  66. /* */
  67. /* <Description> */
  68. /* This section describes the public high-level API of FreeType~2. */
  69. /* */
  70. /* <Order> */
  71. /* FT_Library */
  72. /* FT_Face */
  73. /* FT_Size */
  74. /* FT_GlyphSlot */
  75. /* FT_CharMap */
  76. /* FT_Encoding */
  77. /* */
  78. /* FT_FaceRec */
  79. /* */
  80. /* FT_FACE_FLAG_SCALABLE */
  81. /* FT_FACE_FLAG_FIXED_SIZES */
  82. /* FT_FACE_FLAG_FIXED_WIDTH */
  83. /* FT_FACE_FLAG_HORIZONTAL */
  84. /* FT_FACE_FLAG_VERTICAL */
  85. /* FT_FACE_FLAG_SFNT */
  86. /* FT_FACE_FLAG_KERNING */
  87. /* FT_FACE_FLAG_MULTIPLE_MASTERS */
  88. /* FT_FACE_FLAG_GLYPH_NAMES */
  89. /* FT_FACE_FLAG_EXTERNAL_STREAM */
  90. /* FT_FACE_FLAG_FAST_GLYPHS */
  91. /* FT_FACE_FLAG_HINTER */
  92. /* */
  93. /* FT_STYLE_FLAG_BOLD */
  94. /* FT_STYLE_FLAG_ITALIC */
  95. /* */
  96. /* FT_SizeRec */
  97. /* FT_Size_Metrics */
  98. /* */
  99. /* FT_GlyphSlotRec */
  100. /* FT_Glyph_Metrics */
  101. /* FT_SubGlyph */
  102. /* */
  103. /* FT_Bitmap_Size */
  104. /* */
  105. /* FT_Init_FreeType */
  106. /* FT_Done_FreeType */
  107. /* */
  108. /* FT_New_Face */
  109. /* FT_Done_Face */
  110. /* FT_New_Memory_Face */
  111. /* FT_Open_Face */
  112. /* FT_Open_Args */
  113. /* FT_Parameter */
  114. /* FT_Attach_File */
  115. /* FT_Attach_Stream */
  116. /* */
  117. /* FT_Set_Char_Size */
  118. /* FT_Set_Pixel_Sizes */
  119. /* FT_Request_Size */
  120. /* FT_Select_Size */
  121. /* FT_Size_Request_Type */
  122. /* FT_Size_Request */
  123. /* FT_Set_Transform */
  124. /* FT_Load_Glyph */
  125. /* FT_Get_Char_Index */
  126. /* FT_Get_Name_Index */
  127. /* FT_Load_Char */
  128. /* */
  129. /* FT_OPEN_MEMORY */
  130. /* FT_OPEN_STREAM */
  131. /* FT_OPEN_PATHNAME */
  132. /* FT_OPEN_DRIVER */
  133. /* FT_OPEN_PARAMS */
  134. /* */
  135. /* FT_LOAD_DEFAULT */
  136. /* FT_LOAD_RENDER */
  137. /* FT_LOAD_MONOCHROME */
  138. /* FT_LOAD_LINEAR_DESIGN */
  139. /* FT_LOAD_NO_SCALE */
  140. /* FT_LOAD_NO_HINTING */
  141. /* FT_LOAD_NO_BITMAP */
  142. /* FT_LOAD_CROP_BITMAP */
  143. /* */
  144. /* FT_LOAD_VERTICAL_LAYOUT */
  145. /* FT_LOAD_IGNORE_TRANSFORM */
  146. /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
  147. /* FT_LOAD_FORCE_AUTOHINT */
  148. /* FT_LOAD_NO_RECURSE */
  149. /* FT_LOAD_PEDANTIC */
  150. /* */
  151. /* FT_LOAD_TARGET_NORMAL */
  152. /* FT_LOAD_TARGET_LIGHT */
  153. /* FT_LOAD_TARGET_MONO */
  154. /* FT_LOAD_TARGET_LCD */
  155. /* FT_LOAD_TARGET_LCD_V */
  156. /* */
  157. /* FT_Render_Glyph */
  158. /* FT_Render_Mode */
  159. /* FT_Get_Kerning */
  160. /* FT_Kerning_Mode */
  161. /* FT_Get_Track_Kerning */
  162. /* FT_Get_Glyph_Name */
  163. /* FT_Get_Postscript_Name */
  164. /* */
  165. /* FT_CharMapRec */
  166. /* FT_Select_Charmap */
  167. /* FT_Set_Charmap */
  168. /* FT_Get_Charmap_Index */
  169. /* */
  170. /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
  171. /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
  172. /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
  173. /* FT_FSTYPE_EDITABLE_EMBEDDING */
  174. /* FT_FSTYPE_NO_SUBSETTING */
  175. /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
  176. /* */
  177. /* FT_Get_FSType_Flags */
  178. /* */
  179. /*************************************************************************/
  180. /*************************************************************************/
  181. /* */
  182. /* <Struct> */
  183. /* FT_Glyph_Metrics */
  184. /* */
  185. /* <Description> */
  186. /* A structure used to model the metrics of a single glyph. The */
  187. /* values are expressed in 26.6 fractional pixel format; if the flag */
  188. /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
  189. /* are expressed in font units instead. */
  190. /* */
  191. /* <Fields> */
  192. /* width :: */
  193. /* The glyph's width. */
  194. /* */
  195. /* height :: */
  196. /* The glyph's height. */
  197. /* */
  198. /* horiBearingX :: */
  199. /* Left side bearing for horizontal layout. */
  200. /* */
  201. /* horiBearingY :: */
  202. /* Top side bearing for horizontal layout. */
  203. /* */
  204. /* horiAdvance :: */
  205. /* Advance width for horizontal layout. */
  206. /* */
  207. /* vertBearingX :: */
  208. /* Left side bearing for vertical layout. */
  209. /* */
  210. /* vertBearingY :: */
  211. /* Top side bearing for vertical layout. Larger positive values */
  212. /* mean further below the vertical glyph origin. */
  213. /* */
  214. /* vertAdvance :: */
  215. /* Advance height for vertical layout. Positive values mean the */
  216. /* glyph has a positive advance downward. */
  217. /* */
  218. /* <Note> */
  219. /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
  220. /* dimensions of the hinted glyph (in case hinting is applicable). */
  221. /* */
  222. /* Stroking a glyph with an outside border does not increase */
  223. /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
  224. /* values to account for the added width and height. */
  225. /* */
  226. typedef struct FT_Glyph_Metrics_
  227. {
  228. FT_Pos width;
  229. FT_Pos height;
  230. FT_Pos horiBearingX;
  231. FT_Pos horiBearingY;
  232. FT_Pos horiAdvance;
  233. FT_Pos vertBearingX;
  234. FT_Pos vertBearingY;
  235. FT_Pos vertAdvance;
  236. } FT_Glyph_Metrics;
  237. /*************************************************************************/
  238. /* */
  239. /* <Struct> */
  240. /* FT_Bitmap_Size */
  241. /* */
  242. /* <Description> */
  243. /* This structure models the metrics of a bitmap strike (i.e., a set */
  244. /* of glyphs for a given point size and resolution) in a bitmap font. */
  245. /* It is used for the `available_sizes' field of @FT_Face. */
  246. /* */
  247. /* <Fields> */
  248. /* height :: The vertical distance, in pixels, between two */
  249. /* consecutive baselines. It is always positive. */
  250. /* */
  251. /* width :: The average width, in pixels, of all glyphs in the */
  252. /* strike. */
  253. /* */
  254. /* size :: The nominal size of the strike in 26.6 fractional */
  255. /* points. This field is not very useful. */
  256. /* */
  257. /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
  258. /* pixels. */
  259. /* */
  260. /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
  261. /* pixels. */
  262. /* */
  263. /* <Note> */
  264. /* Windows FNT: */
  265. /* The nominal size given in a FNT font is not reliable. Thus when */
  266. /* the driver finds it incorrect, it sets `size' to some calculated */
  267. /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
  268. /* height given in the font, respectively. */
  269. /* */
  270. /* TrueType embedded bitmaps: */
  271. /* `size', `width', and `height' values are not contained in the */
  272. /* bitmap strike itself. They are computed from the global font */
  273. /* parameters. */
  274. /* */
  275. typedef struct FT_Bitmap_Size_
  276. {
  277. FT_Short height;
  278. FT_Short width;
  279. FT_Pos size;
  280. FT_Pos x_ppem;
  281. FT_Pos y_ppem;
  282. } FT_Bitmap_Size;
  283. /*************************************************************************/
  284. /*************************************************************************/
  285. /* */
  286. /* O B J E C T C L A S S E S */
  287. /* */
  288. /*************************************************************************/
  289. /*************************************************************************/
  290. /*************************************************************************/
  291. /* */
  292. /* <Type> */
  293. /* FT_Library */
  294. /* */
  295. /* <Description> */
  296. /* A handle to a FreeType library instance. Each `library' is */
  297. /* completely independent from the others; it is the `root' of a set */
  298. /* of objects like fonts, faces, sizes, etc. */
  299. /* */
  300. /* It also embeds a memory manager (see @FT_Memory), as well as a */
  301. /* scan-line converter object (see @FT_Raster). */
  302. /* */
  303. /* For multi-threading applications each thread should have its own */
  304. /* FT_Library object. */
  305. /* */
  306. /* <Note> */
  307. /* Library objects are normally created by @FT_Init_FreeType, and */
  308. /* destroyed with @FT_Done_FreeType. */
  309. /* */
  310. typedef struct FT_LibraryRec_ *FT_Library;
  311. /*************************************************************************/
  312. /* */
  313. /* <Type> */
  314. /* FT_Module */
  315. /* */
  316. /* <Description> */
  317. /* A handle to a given FreeType module object. Each module can be a */
  318. /* font driver, a renderer, or anything else that provides services */
  319. /* to the formers. */
  320. /* */
  321. typedef struct FT_ModuleRec_* FT_Module;
  322. /*************************************************************************/
  323. /* */
  324. /* <Type> */
  325. /* FT_Driver */
  326. /* */
  327. /* <Description> */
  328. /* A handle to a given FreeType font driver object. Each font driver */
  329. /* is a special module capable of creating faces from font files. */
  330. /* */
  331. typedef struct FT_DriverRec_* FT_Driver;
  332. /*************************************************************************/
  333. /* */
  334. /* <Type> */
  335. /* FT_Renderer */
  336. /* */
  337. /* <Description> */
  338. /* A handle to a given FreeType renderer. A renderer is a special */
  339. /* module in charge of converting a glyph image to a bitmap, when */
  340. /* necessary. Each renderer supports a given glyph image format, and */
  341. /* one or more target surface depths. */
  342. /* */
  343. typedef struct FT_RendererRec_* FT_Renderer;
  344. /*************************************************************************/
  345. /* */
  346. /* <Type> */
  347. /* FT_Face */
  348. /* */
  349. /* <Description> */
  350. /* A handle to a given typographic face object. A face object models */
  351. /* a given typeface, in a given style. */
  352. /* */
  353. /* <Note> */
  354. /* Each face object also owns a single @FT_GlyphSlot object, as well */
  355. /* as one or more @FT_Size objects. */
  356. /* */
  357. /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
  358. /* a given filepathname or a custom input stream. */
  359. /* */
  360. /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
  361. /* */
  362. /* <Also> */
  363. /* See @FT_FaceRec for the publicly accessible fields of a given face */
  364. /* object. */
  365. /* */
  366. typedef struct FT_FaceRec_* FT_Face;
  367. /*************************************************************************/
  368. /* */
  369. /* <Type> */
  370. /* FT_Size */
  371. /* */
  372. /* <Description> */
  373. /* A handle to an object used to model a face scaled to a given */
  374. /* character size. */
  375. /* */
  376. /* <Note> */
  377. /* Each @FT_Face has an _active_ @FT_Size object that is used by */
  378. /* functions like @FT_Load_Glyph to determine the scaling */
  379. /* transformation which is used to load and hint glyphs and metrics. */
  380. /* */
  381. /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
  382. /* @FT_Request_Size or even @FT_Select_Size to change the content */
  383. /* (i.e., the scaling values) of the active @FT_Size. */
  384. /* */
  385. /* You can use @FT_New_Size to create additional size objects for a */
  386. /* given @FT_Face, but they won't be used by other functions until */
  387. /* you activate it through @FT_Activate_Size. Only one size can be */
  388. /* activated at any given time per face. */
  389. /* */
  390. /* <Also> */
  391. /* See @FT_SizeRec for the publicly accessible fields of a given size */
  392. /* object. */
  393. /* */
  394. typedef struct FT_SizeRec_* FT_Size;
  395. /*************************************************************************/
  396. /* */
  397. /* <Type> */
  398. /* FT_GlyphSlot */
  399. /* */
  400. /* <Description> */
  401. /* A handle to a given `glyph slot'. A slot is a container where it */
  402. /* is possible to load any of the glyphs contained in its parent */
  403. /* face. */
  404. /* */
  405. /* In other words, each time you call @FT_Load_Glyph or */
  406. /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
  407. /* i.e., the glyph's metrics, its image (bitmap or outline), and */
  408. /* other control information. */
  409. /* */
  410. /* <Also> */
  411. /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
  412. /* */
  413. typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
  414. /*************************************************************************/
  415. /* */
  416. /* <Type> */
  417. /* FT_CharMap */
  418. /* */
  419. /* <Description> */
  420. /* A handle to a given character map. A charmap is used to translate */
  421. /* character codes in a given encoding into glyph indexes for its */
  422. /* parent's face. Some font formats may provide several charmaps per */
  423. /* font. */
  424. /* */
  425. /* Each face object owns zero or more charmaps, but only one of them */
  426. /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
  427. /* */
  428. /* The list of available charmaps in a face is available through the */
  429. /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
  430. /* */
  431. /* The currently active charmap is available as `face->charmap'. */
  432. /* You should call @FT_Set_Charmap to change it. */
  433. /* */
  434. /* <Note> */
  435. /* When a new face is created (either through @FT_New_Face or */
  436. /* @FT_Open_Face), the library looks for a Unicode charmap within */
  437. /* the list and automatically activates it. */
  438. /* */
  439. /* <Also> */
  440. /* See @FT_CharMapRec for the publicly accessible fields of a given */
  441. /* character map. */
  442. /* */
  443. typedef struct FT_CharMapRec_* FT_CharMap;
  444. /*************************************************************************/
  445. /* */
  446. /* <Macro> */
  447. /* FT_ENC_TAG */
  448. /* */
  449. /* <Description> */
  450. /* This macro converts four-letter tags into an unsigned long. It is */
  451. /* used to define `encoding' identifiers (see @FT_Encoding). */
  452. /* */
  453. /* <Note> */
  454. /* Since many 16-bit compilers don't like 32-bit enumerations, you */
  455. /* should redefine this macro in case of problems to something like */
  456. /* this: */
  457. /* */
  458. /* { */
  459. /* #define FT_ENC_TAG( value, a, b, c, d ) value */
  460. /* } */
  461. /* */
  462. /* to get a simple enumeration without assigning special numbers. */
  463. /* */
  464. #ifndef FT_ENC_TAG
  465. #define FT_ENC_TAG( value, a, b, c, d ) \
  466. value = ( ( (FT_UInt32)(a) << 24 ) | \
  467. ( (FT_UInt32)(b) << 16 ) | \
  468. ( (FT_UInt32)(c) << 8 ) | \
  469. (FT_UInt32)(d) )
  470. #endif /* FT_ENC_TAG */
  471. /*************************************************************************/
  472. /* */
  473. /* <Enum> */
  474. /* FT_Encoding */
  475. /* */
  476. /* <Description> */
  477. /* An enumeration used to specify character sets supported by */
  478. /* charmaps. Used in the @FT_Select_Charmap API function. */
  479. /* */
  480. /* <Note> */
  481. /* Despite the name, this enumeration lists specific character */
  482. /* repertories (i.e., charsets), and not text encoding methods (e.g., */
  483. /* UTF-8, UTF-16, etc.). */
  484. /* */
  485. /* Other encodings might be defined in the future. */
  486. /* */
  487. /* <Values> */
  488. /* FT_ENCODING_NONE :: */
  489. /* The encoding value~0 is reserved. */
  490. /* */
  491. /* FT_ENCODING_UNICODE :: */
  492. /* Corresponds to the Unicode character set. This value covers */
  493. /* all versions of the Unicode repertoire, including ASCII and */
  494. /* Latin-1. Most fonts include a Unicode charmap, but not all */
  495. /* of them. */
  496. /* */
  497. /* For example, if you want to access Unicode value U+1F028 (and */
  498. /* the font contains it), use value 0x1F028 as the input value for */
  499. /* @FT_Get_Char_Index. */
  500. /* */
  501. /* FT_ENCODING_MS_SYMBOL :: */
  502. /* Corresponds to the Microsoft Symbol encoding, used to encode */
  503. /* mathematical symbols in the 32..255 character code range. For */
  504. /* more information, see `http://www.ceviz.net/symbol.htm'. */
  505. /* */
  506. /* FT_ENCODING_SJIS :: */
  507. /* Corresponds to Japanese SJIS encoding. More info at */
  508. /* at `http://langsupport.japanreference.com/encoding.shtml'. */
  509. /* See note on multi-byte encodings below. */
  510. /* */
  511. /* FT_ENCODING_GB2312 :: */
  512. /* Corresponds to an encoding system for Simplified Chinese as used */
  513. /* used in mainland China. */
  514. /* */
  515. /* FT_ENCODING_BIG5 :: */
  516. /* Corresponds to an encoding system for Traditional Chinese as */
  517. /* used in Taiwan and Hong Kong. */
  518. /* */
  519. /* FT_ENCODING_WANSUNG :: */
  520. /* Corresponds to the Korean encoding system known as Wansung. */
  521. /* For more information see */
  522. /* `http://www.microsoft.com/typography/unicode/949.txt'. */
  523. /* */
  524. /* FT_ENCODING_JOHAB :: */
  525. /* The Korean standard character set (KS~C 5601-1992), which */
  526. /* corresponds to MS Windows code page 1361. This character set */
  527. /* includes all possible Hangeul character combinations. */
  528. /* */
  529. /* FT_ENCODING_ADOBE_LATIN_1 :: */
  530. /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
  531. /* PostScript font. It is limited to 256 character codes. */
  532. /* */
  533. /* FT_ENCODING_ADOBE_STANDARD :: */
  534. /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
  535. /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
  536. /* codes. */
  537. /* */
  538. /* FT_ENCODING_ADOBE_EXPERT :: */
  539. /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
  540. /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
  541. /* codes. */
  542. /* */
  543. /* FT_ENCODING_ADOBE_CUSTOM :: */
  544. /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
  545. /* OpenType/CFF fonts. It is limited to 256 character codes. */
  546. /* */
  547. /* FT_ENCODING_APPLE_ROMAN :: */
  548. /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
  549. /* and OpenType fonts contain a charmap for this encoding, since */
  550. /* older versions of Mac OS are able to use it. */
  551. /* */
  552. /* FT_ENCODING_OLD_LATIN_2 :: */
  553. /* This value is deprecated and was never used nor reported by */
  554. /* FreeType. Don't use or test for it. */
  555. /* */
  556. /* FT_ENCODING_MS_SJIS :: */
  557. /* Same as FT_ENCODING_SJIS. Deprecated. */
  558. /* */
  559. /* FT_ENCODING_MS_GB2312 :: */
  560. /* Same as FT_ENCODING_GB2312. Deprecated. */
  561. /* */
  562. /* FT_ENCODING_MS_BIG5 :: */
  563. /* Same as FT_ENCODING_BIG5. Deprecated. */
  564. /* */
  565. /* FT_ENCODING_MS_WANSUNG :: */
  566. /* Same as FT_ENCODING_WANSUNG. Deprecated. */
  567. /* */
  568. /* FT_ENCODING_MS_JOHAB :: */
  569. /* Same as FT_ENCODING_JOHAB. Deprecated. */
  570. /* */
  571. /* <Note> */
  572. /* By default, FreeType automatically synthesizes a Unicode charmap */
  573. /* for PostScript fonts, using their glyph names dictionaries. */
  574. /* However, it also reports the encodings defined explicitly in the */
  575. /* font file, for the cases when they are needed, with the Adobe */
  576. /* values as well. */
  577. /* */
  578. /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
  579. /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
  580. /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
  581. /* which encoding is really present. If, for example, the */
  582. /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
  583. /* the font is encoded in KOI8-R. */
  584. /* */
  585. /* FT_ENCODING_NONE is always set (with a single exception) by the */
  586. /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
  587. /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
  588. /* which encoding is really present. For example, */
  589. /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
  590. /* Russian). */
  591. /* */
  592. /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
  593. /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
  594. /* FT_ENCODING_APPLE_ROMAN). */
  595. /* */
  596. /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
  597. /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
  598. /* be needed to be able to distinguish Apple encoding variants. See */
  599. /* */
  600. /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
  601. /* */
  602. /* to get an idea how to do that. Basically, if the language ID */
  603. /* is~0, don't use it, otherwise subtract 1 from the language ID. */
  604. /* Then examine `encoding_id'. If, for example, `encoding_id' is */
  605. /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
  606. /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
  607. /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
  608. /* variant the Arabic encoding. */
  609. /* */
  610. typedef enum FT_Encoding_
  611. {
  612. FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
  613. FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
  614. FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
  615. FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
  616. FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
  617. FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
  618. FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
  619. FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
  620. /* for backwards compatibility */
  621. FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
  622. FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
  623. FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
  624. FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
  625. FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
  626. FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
  627. FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
  628. FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
  629. FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
  630. FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
  631. FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
  632. } FT_Encoding;
  633. /*************************************************************************/
  634. /* */
  635. /* <Enum> */
  636. /* ft_encoding_xxx */
  637. /* */
  638. /* <Description> */
  639. /* These constants are deprecated; use the corresponding @FT_Encoding */
  640. /* values instead. */
  641. /* */
  642. #define ft_encoding_none FT_ENCODING_NONE
  643. #define ft_encoding_unicode FT_ENCODING_UNICODE
  644. #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
  645. #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
  646. #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
  647. #define ft_encoding_sjis FT_ENCODING_SJIS
  648. #define ft_encoding_gb2312 FT_ENCODING_GB2312
  649. #define ft_encoding_big5 FT_ENCODING_BIG5
  650. #define ft_encoding_wansung FT_ENCODING_WANSUNG
  651. #define ft_encoding_johab FT_ENCODING_JOHAB
  652. #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
  653. #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
  654. #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
  655. #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
  656. /*************************************************************************/
  657. /* */
  658. /* <Struct> */
  659. /* FT_CharMapRec */
  660. /* */
  661. /* <Description> */
  662. /* The base charmap structure. */
  663. /* */
  664. /* <Fields> */
  665. /* face :: A handle to the parent face object. */
  666. /* */
  667. /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
  668. /* this with @FT_Select_Charmap. */
  669. /* */
  670. /* platform_id :: An ID number describing the platform for the */
  671. /* following encoding ID. This comes directly from */
  672. /* the TrueType specification and should be emulated */
  673. /* for other formats. */
  674. /* */
  675. /* encoding_id :: A platform specific encoding number. This also */
  676. /* comes from the TrueType specification and should be */
  677. /* emulated similarly. */
  678. /* */
  679. typedef struct FT_CharMapRec_
  680. {
  681. FT_Face face;
  682. FT_Encoding encoding;
  683. FT_UShort platform_id;
  684. FT_UShort encoding_id;
  685. } FT_CharMapRec;
  686. /*************************************************************************/
  687. /*************************************************************************/
  688. /* */
  689. /* B A S E O B J E C T C L A S S E S */
  690. /* */
  691. /*************************************************************************/
  692. /*************************************************************************/
  693. /*************************************************************************/
  694. /* */
  695. /* <Type> */
  696. /* FT_Face_Internal */
  697. /* */
  698. /* <Description> */
  699. /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
  700. /* model private data of a given @FT_Face object. */
  701. /* */
  702. /* This structure might change between releases of FreeType~2 and is */
  703. /* not generally available to client applications. */
  704. /* */
  705. typedef struct FT_Face_InternalRec_* FT_Face_Internal;
  706. /*************************************************************************/
  707. /* */
  708. /* <Struct> */
  709. /* FT_FaceRec */
  710. /* */
  711. /* <Description> */
  712. /* FreeType root face class structure. A face object models a */
  713. /* typeface in a font file. */
  714. /* */
  715. /* <Fields> */
  716. /* num_faces :: The number of faces in the font file. Some */
  717. /* font formats can have multiple faces in */
  718. /* a font file. */
  719. /* */
  720. /* face_index :: The index of the face in the font file. It */
  721. /* is set to~0 if there is only one face in */
  722. /* the font file. */
  723. /* */
  724. /* face_flags :: A set of bit flags that give important */
  725. /* information about the face; see */
  726. /* @FT_FACE_FLAG_XXX for the details. */
  727. /* */
  728. /* style_flags :: A set of bit flags indicating the style of */
  729. /* the face; see @FT_STYLE_FLAG_XXX for the */
  730. /* details. */
  731. /* */
  732. /* num_glyphs :: The number of glyphs in the face. If the */
  733. /* face is scalable and has sbits (see */
  734. /* `num_fixed_sizes'), it is set to the number */
  735. /* of outline glyphs. */
  736. /* */
  737. /* For CID-keyed fonts, this value gives the */
  738. /* highest CID used in the font. */
  739. /* */
  740. /* family_name :: The face's family name. This is an ASCII */
  741. /* string, usually in English, which describes */
  742. /* the typeface's family (like `Times New */
  743. /* Roman', `Bodoni', `Garamond', etc). This */
  744. /* is a least common denominator used to list */
  745. /* fonts. Some formats (TrueType & OpenType) */
  746. /* provide localized and Unicode versions of */
  747. /* this string. Applications should use the */
  748. /* format specific interface to access them. */
  749. /* Can be NULL (e.g., in fonts embedded in a */
  750. /* PDF file). */
  751. /* */
  752. /* style_name :: The face's style name. This is an ASCII */
  753. /* string, usually in English, which describes */
  754. /* the typeface's style (like `Italic', */
  755. /* `Bold', `Condensed', etc). Not all font */
  756. /* formats provide a style name, so this field */
  757. /* is optional, and can be set to NULL. As */
  758. /* for `family_name', some formats provide */
  759. /* localized and Unicode versions of this */
  760. /* string. Applications should use the format */
  761. /* specific interface to access them. */
  762. /* */
  763. /* num_fixed_sizes :: The number of bitmap strikes in the face. */
  764. /* Even if the face is scalable, there might */
  765. /* still be bitmap strikes, which are called */
  766. /* `sbits' in that case. */
  767. /* */
  768. /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
  769. /* strikes in the face. It is set to NULL if */
  770. /* there is no bitmap strike. */
  771. /* */
  772. /* num_charmaps :: The number of charmaps in the face. */
  773. /* */
  774. /* charmaps :: An array of the charmaps of the face. */
  775. /* */
  776. /* generic :: A field reserved for client uses. See the */
  777. /* @FT_Generic type description. */
  778. /* */
  779. /* bbox :: The font bounding box. Coordinates are */
  780. /* expressed in font units (see */
  781. /* `units_per_EM'). The box is large enough */
  782. /* to contain any glyph from the font. Thus, */
  783. /* `bbox.yMax' can be seen as the `maximum */
  784. /* ascender', and `bbox.yMin' as the `minimum */
  785. /* descender'. Only relevant for scalable */
  786. /* formats. */
  787. /* */
  788. /* Note that the bounding box might be off by */
  789. /* (at least) one pixel for hinted fonts. See */
  790. /* @FT_Size_Metrics for further discussion. */
  791. /* */
  792. /* units_per_EM :: The number of font units per EM square for */
  793. /* this face. This is typically 2048 for */
  794. /* TrueType fonts, and 1000 for Type~1 fonts. */
  795. /* Only relevant for scalable formats. */
  796. /* */
  797. /* ascender :: The typographic ascender of the face, */
  798. /* expressed in font units. For font formats */
  799. /* not having this information, it is set to */
  800. /* `bbox.yMax'. Only relevant for scalable */
  801. /* formats. */
  802. /* */
  803. /* descender :: The typographic descender of the face, */
  804. /* expressed in font units. For font formats */
  805. /* not having this information, it is set to */
  806. /* `bbox.yMin'. Note that this field is */
  807. /* usually negative. Only relevant for */
  808. /* scalable formats. */
  809. /* */
  810. /* height :: This value is the vertical distance */
  811. /* between two consecutive baselines, */
  812. /* expressed in font units. It is always */
  813. /* positive. Only relevant for scalable */
  814. /* formats. */
  815. /* */
  816. /* If you want the global glyph height, use */
  817. /* `ascender - descender'. */
  818. /* */
  819. /* max_advance_width :: The maximum advance width, in font units, */
  820. /* for all glyphs in this face. This can be */
  821. /* used to make word wrapping computations */
  822. /* faster. Only relevant for scalable */
  823. /* formats. */
  824. /* */
  825. /* max_advance_height :: The maximum advance height, in font units, */
  826. /* for all glyphs in this face. This is only */
  827. /* relevant for vertical layouts, and is set */
  828. /* to `height' for fonts that do not provide */
  829. /* vertical metrics. Only relevant for */
  830. /* scalable formats. */
  831. /* */
  832. /* underline_position :: The position, in font units, of the */
  833. /* underline line for this face. It is the */
  834. /* center of the underlining stem. Only */
  835. /* relevant for scalable formats. */
  836. /* */
  837. /* underline_thickness :: The thickness, in font units, of the */
  838. /* underline for this face. Only relevant for */
  839. /* scalable formats. */
  840. /* */
  841. /* glyph :: The face's associated glyph slot(s). */
  842. /* */
  843. /* size :: The current active size for this face. */
  844. /* */
  845. /* charmap :: The current active charmap for this face. */
  846. /* */
  847. /* <Note> */
  848. /* Fields may be changed after a call to @FT_Attach_File or */
  849. /* @FT_Attach_Stream. */
  850. /* */
  851. typedef struct FT_FaceRec_
  852. {
  853. FT_Long num_faces;
  854. FT_Long face_index;
  855. FT_Long face_flags;
  856. FT_Long style_flags;
  857. FT_Long num_glyphs;
  858. FT_String* family_name;
  859. FT_String* style_name;
  860. FT_Int num_fixed_sizes;
  861. FT_Bitmap_Size* available_sizes;
  862. FT_Int num_charmaps;
  863. FT_CharMap* charmaps;
  864. FT_Generic generic;
  865. /*# The following member variables (down to `underline_thickness') */
  866. /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
  867. /*# for bitmap fonts. */
  868. FT_BBox bbox;
  869. FT_UShort units_per_EM;
  870. FT_Short ascender;
  871. FT_Short descender;
  872. FT_Short height;
  873. FT_Short max_advance_width;
  874. FT_Short max_advance_height;
  875. FT_Short underline_position;
  876. FT_Short underline_thickness;
  877. FT_GlyphSlot glyph;
  878. FT_Size size;
  879. FT_CharMap charmap;
  880. /*@private begin */
  881. FT_Driver driver;
  882. FT_Memory memory;
  883. FT_Stream stream;
  884. FT_ListRec sizes_list;
  885. FT_Generic autohint; /* face-specific auto-hinter data */
  886. void* extensions; /* unused */
  887. FT_Face_Internal internal;
  888. /*@private end */
  889. } FT_FaceRec;
  890. /*************************************************************************/
  891. /* */
  892. /* <Enum> */
  893. /* FT_FACE_FLAG_XXX */
  894. /* */
  895. /* <Description> */
  896. /* A list of bit flags used in the `face_flags' field of the */
  897. /* @FT_FaceRec structure. They inform client applications of */
  898. /* properties of the corresponding face. */
  899. /* */
  900. /* <Values> */
  901. /* FT_FACE_FLAG_SCALABLE :: */
  902. /* Indicates that the face contains outline glyphs. This doesn't */
  903. /* prevent bitmap strikes, i.e., a face can have both this and */
  904. /* and @FT_FACE_FLAG_FIXED_SIZES set. */
  905. /* */
  906. /* FT_FACE_FLAG_FIXED_SIZES :: */
  907. /* Indicates that the face contains bitmap strikes. See also the */
  908. /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
  909. /* */
  910. /* FT_FACE_FLAG_FIXED_WIDTH :: */
  911. /* Indicates that the face contains fixed-width characters (like */
  912. /* Courier, Lucido, MonoType, etc.). */
  913. /* */
  914. /* FT_FACE_FLAG_SFNT :: */
  915. /* Indicates that the face uses the `sfnt' storage scheme. For */
  916. /* now, this means TrueType and OpenType. */
  917. /* */
  918. /* FT_FACE_FLAG_HORIZONTAL :: */
  919. /* Indicates that the face contains horizontal glyph metrics. This */
  920. /* should be set for all common formats. */
  921. /* */
  922. /* FT_FACE_FLAG_VERTICAL :: */
  923. /* Indicates that the face contains vertical glyph metrics. This */
  924. /* is only available in some formats, not all of them. */
  925. /* */
  926. /* FT_FACE_FLAG_KERNING :: */
  927. /* Indicates that the face contains kerning information. If set, */
  928. /* the kerning distance can be retrieved through the function */
  929. /* @FT_Get_Kerning. Otherwise the function always return the */
  930. /* vector (0,0). Note that FreeType doesn't handle kerning data */
  931. /* from the `GPOS' table (as present in some OpenType fonts). */
  932. /* */
  933. /* FT_FACE_FLAG_FAST_GLYPHS :: */
  934. /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
  935. /* */
  936. /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
  937. /* Indicates that the font contains multiple masters and is capable */
  938. /* of interpolating between them. See the multiple-masters */
  939. /* specific API for details. */
  940. /* */
  941. /* FT_FACE_FLAG_GLYPH_NAMES :: */
  942. /* Indicates that the font contains glyph names that can be */
  943. /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
  944. /* fonts contain broken glyph name tables. Use the function */
  945. /* @FT_Has_PS_Glyph_Names when needed. */
  946. /* */
  947. /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
  948. /* Used internally by FreeType to indicate that a face's stream was */
  949. /* provided by the client application and should not be destroyed */
  950. /* when @FT_Done_Face is called. Don't read or test this flag. */
  951. /* */
  952. /* FT_FACE_FLAG_HINTER :: */
  953. /* Set if the font driver has a hinting machine of its own. For */
  954. /* example, with TrueType fonts, it makes sense to use data from */
  955. /* the SFNT `gasp' table only if the native TrueType hinting engine */
  956. /* (with the bytecode interpreter) is available and active. */
  957. /* */
  958. /* FT_FACE_FLAG_CID_KEYED :: */
  959. /* Set if the font is CID-keyed. In that case, the font is not */
  960. /* accessed by glyph indices but by CID values. For subsetted */
  961. /* CID-keyed fonts this has the consequence that not all index */
  962. /* values are a valid argument to FT_Load_Glyph. Only the CID */
  963. /* values for which corresponding glyphs in the subsetted font */
  964. /* exist make FT_Load_Glyph return successfully; in all other cases */
  965. /* you get an `FT_Err_Invalid_Argument' error. */
  966. /* */
  967. /* Note that CID-keyed fonts which are in an SFNT wrapper don't */
  968. /* have this flag set since the glyphs are accessed in the normal */
  969. /* way (using contiguous indices); the `CID-ness' isn't visible to */
  970. /* the application. */
  971. /* */
  972. /* FT_FACE_FLAG_TRICKY :: */
  973. /* Set if the font is `tricky', this is, it always needs the */
  974. /* font format's native hinting engine to get a reasonable result. */
  975. /* A typical example is the Chinese font `mingli.ttf' which uses */
  976. /* TrueType bytecode instructions to move and scale all of its */
  977. /* subglyphs. */
  978. /* */
  979. /* It is not possible to autohint such fonts using */
  980. /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
  981. /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
  982. /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
  983. /* probably never want this except for demonstration purposes. */
  984. /* */
  985. /* Currently, there are about a dozen TrueType fonts in the list of */
  986. /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
  987. /* */
  988. #define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
  989. #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
  990. #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
  991. #define FT_FACE_FLAG_SFNT ( 1L << 3 )
  992. #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
  993. #define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
  994. #define FT_FACE_FLAG_KERNING ( 1L << 6 )
  995. #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
  996. #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
  997. #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
  998. #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
  999. #define FT_FACE_FLAG_HINTER ( 1L << 11 )
  1000. #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
  1001. #define FT_FACE_FLAG_TRICKY ( 1L << 13 )
  1002. /*************************************************************************
  1003. *
  1004. * @macro:
  1005. * FT_HAS_HORIZONTAL( face )
  1006. *
  1007. * @description:
  1008. * A macro that returns true whenever a face object contains
  1009. * horizontal metrics (this is true for all font formats though).
  1010. *
  1011. * @also:
  1012. * @FT_HAS_VERTICAL can be used to check for vertical metrics.
  1013. *
  1014. */
  1015. #define FT_HAS_HORIZONTAL( face ) \
  1016. ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
  1017. /*************************************************************************
  1018. *
  1019. * @macro:
  1020. * FT_HAS_VERTICAL( face )
  1021. *
  1022. * @description:
  1023. * A macro that returns true whenever a face object contains real
  1024. * vertical metrics (and not only synthesized ones).
  1025. *
  1026. */
  1027. #define FT_HAS_VERTICAL( face ) \
  1028. ( face->face_flags & FT_FACE_FLAG_VERTICAL )
  1029. /*************************************************************************
  1030. *
  1031. * @macro:
  1032. * FT_HAS_KERNING( face )
  1033. *
  1034. * @description:
  1035. * A macro that returns true whenever a face object contains kerning
  1036. * data that can be accessed with @FT_Get_Kerning.
  1037. *
  1038. */
  1039. #define FT_HAS_KERNING( face ) \
  1040. ( face->face_flags & FT_FACE_FLAG_KERNING )
  1041. /*************************************************************************
  1042. *
  1043. * @macro:
  1044. * FT_IS_SCALABLE( face )
  1045. *
  1046. * @description:
  1047. * A macro that returns true whenever a face object contains a scalable
  1048. * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
  1049. * and PFR font formats.
  1050. *
  1051. */
  1052. #define FT_IS_SCALABLE( face ) \
  1053. ( face->face_flags & FT_FACE_FLAG_SCALABLE )
  1054. /*************************************************************************
  1055. *
  1056. * @macro:
  1057. * FT_IS_SFNT( face )
  1058. *
  1059. * @description:
  1060. * A macro that returns true whenever a face object contains a font
  1061. * whose format is based on the SFNT storage scheme. This usually
  1062. * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
  1063. * bitmap fonts.
  1064. *
  1065. * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
  1066. * @FT_TRUETYPE_TABLES_H are available.
  1067. *
  1068. */
  1069. #define FT_IS_SFNT( face ) \
  1070. ( face->face_flags & FT_FACE_FLAG_SFNT )
  1071. /*************************************************************************
  1072. *
  1073. * @macro:
  1074. * FT_IS_FIXED_WIDTH( face )
  1075. *
  1076. * @description:
  1077. * A macro that returns true whenever a face object contains a font face
  1078. * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
  1079. * glyphs.
  1080. *
  1081. */
  1082. #define FT_IS_FIXED_WIDTH( face ) \
  1083. ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
  1084. /*************************************************************************
  1085. *
  1086. * @macro:
  1087. * FT_HAS_FIXED_SIZES( face )
  1088. *
  1089. * @description:
  1090. * A macro that returns true whenever a face object contains some
  1091. * embedded bitmaps. See the `available_sizes' field of the
  1092. * @FT_FaceRec structure.
  1093. *
  1094. */
  1095. #define FT_HAS_FIXED_SIZES( face ) \
  1096. ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
  1097. /*************************************************************************
  1098. *
  1099. * @macro:
  1100. * FT_HAS_FAST_GLYPHS( face )
  1101. *
  1102. * @description:
  1103. * Deprecated.
  1104. *
  1105. */
  1106. #define FT_HAS_FAST_GLYPHS( face ) 0
  1107. /*************************************************************************
  1108. *
  1109. * @macro:
  1110. * FT_HAS_GLYPH_NAMES( face )
  1111. *
  1112. * @description:
  1113. * A macro that returns true whenever a face object contains some glyph
  1114. * names that can be accessed through @FT_Get_Glyph_Name.
  1115. *
  1116. */
  1117. #define FT_HAS_GLYPH_NAMES( face ) \
  1118. ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
  1119. /*************************************************************************
  1120. *
  1121. * @macro:
  1122. * FT_HAS_MULTIPLE_MASTERS( face )
  1123. *
  1124. * @description:
  1125. * A macro that returns true whenever a face object contains some
  1126. * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
  1127. * are then available to choose the exact design you want.
  1128. *
  1129. */
  1130. #define FT_HAS_MULTIPLE_MASTERS( face ) \
  1131. ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
  1132. /*************************************************************************
  1133. *
  1134. * @macro:
  1135. * FT_IS_CID_KEYED( face )
  1136. *
  1137. * @description:
  1138. * A macro that returns true whenever a face object contains a CID-keyed
  1139. * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
  1140. * details.
  1141. *
  1142. * If this macro is true, all functions defined in @FT_CID_H are
  1143. * available.
  1144. *
  1145. */
  1146. #define FT_IS_CID_KEYED( face ) \
  1147. ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
  1148. /*************************************************************************
  1149. *
  1150. * @macro:
  1151. * FT_IS_TRICKY( face )
  1152. *
  1153. * @description:
  1154. * A macro that returns true whenever a face represents a `tricky' font.
  1155. * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
  1156. *
  1157. */
  1158. #define FT_IS_TRICKY( face ) \
  1159. ( face->face_flags & FT_FACE_FLAG_TRICKY )
  1160. /*************************************************************************/
  1161. /* */
  1162. /* <Const> */
  1163. /* FT_STYLE_FLAG_XXX */
  1164. /* */
  1165. /* <Description> */
  1166. /* A list of bit-flags used to indicate the style of a given face. */
  1167. /* These are used in the `style_flags' field of @FT_FaceRec. */
  1168. /* */
  1169. /* <Values> */
  1170. /* FT_STYLE_FLAG_ITALIC :: */
  1171. /* Indicates that a given face style is italic or oblique. */
  1172. /* */
  1173. /* FT_STYLE_FLAG_BOLD :: */
  1174. /* Indicates that a given face is bold. */
  1175. /* */
  1176. /* <Note> */
  1177. /* The style information as provided by FreeType is very basic. More */
  1178. /* details are beyond the scope and should be done on a higher level */
  1179. /* (for example, by analyzing various fields of the `OS/2' table in */
  1180. /* SFNT based fonts). */
  1181. /* */
  1182. #define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
  1183. #define FT_STYLE_FLAG_BOLD ( 1 << 1 )
  1184. /*************************************************************************/
  1185. /* */
  1186. /* <Type> */
  1187. /* FT_Size_Internal */
  1188. /* */
  1189. /* <Description> */
  1190. /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
  1191. /* model private data of a given @FT_Size object. */
  1192. /* */
  1193. typedef struct FT_Size_InternalRec_* FT_Size_Internal;
  1194. /*************************************************************************/
  1195. /* */
  1196. /* <Struct> */
  1197. /* FT_Size_Metrics */
  1198. /* */
  1199. /* <Description> */
  1200. /* The size metrics structure gives the metrics of a size object. */
  1201. /* */
  1202. /* <Fields> */
  1203. /* x_ppem :: The width of the scaled EM square in pixels, hence */
  1204. /* the term `ppem' (pixels per EM). It is also */
  1205. /* referred to as `nominal width'. */
  1206. /* */
  1207. /* y_ppem :: The height of the scaled EM square in pixels, */
  1208. /* hence the term `ppem' (pixels per EM). It is also */
  1209. /* referred to as `nominal height'. */
  1210. /* */
  1211. /* x_scale :: A 16.16 fractional scaling value used to convert */
  1212. /* horizontal metrics from font units to 26.6 */
  1213. /* fractional pixels. Only relevant for scalable */
  1214. /* font formats. */
  1215. /* */
  1216. /* y_scale :: A 16.16 fractional scaling value used to convert */
  1217. /* vertical metrics from font units to 26.6 */
  1218. /* fractional pixels. Only relevant for scalable */
  1219. /* font formats. */
  1220. /* */
  1221. /* ascender :: The ascender in 26.6 fractional pixels. See */
  1222. /* @FT_FaceRec for the details. */
  1223. /* */
  1224. /* descender :: The descender in 26.6 fractional pixels. See */
  1225. /* @FT_FaceRec for the details. */
  1226. /* */
  1227. /* height :: The height in 26.6 fractional pixels. See */
  1228. /* @FT_FaceRec for the details. */
  1229. /* */
  1230. /* max_advance :: The maximum advance width in 26.6 fractional */
  1231. /* pixels. See @FT_FaceRec for the details. */
  1232. /* */
  1233. /* <Note> */
  1234. /* The scaling values, if relevant, are determined first during a */
  1235. /* size changing operation. The remaining fields are then set by the */
  1236. /* driver. For scalable formats, they are usually set to scaled */
  1237. /* values of the corresponding fields in @FT_FaceRec. */
  1238. /* */
  1239. /* Note that due to glyph hinting, these values might not be exact */
  1240. /* for certain fonts. Thus they must be treated as unreliable */
  1241. /* with an error margin of at least one pixel! */
  1242. /* */
  1243. /* Indeed, the only way to get the exact metrics is to render _all_ */
  1244. /* glyphs. As this would be a definite performance hit, it is up to */
  1245. /* client applications to perform such computations. */
  1246. /* */
  1247. /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
  1248. /* */
  1249. typedef struct FT_Size_Metrics_
  1250. {
  1251. FT_UShort x_ppem; /* horizontal pixels per EM */
  1252. FT_UShort y_ppem; /* vertical pixels per EM */
  1253. FT_Fixed x_scale; /* scaling values used to convert font */
  1254. FT_Fixed y_scale; /* units to 26.6 fractional pixels */
  1255. FT_Pos ascender; /* ascender in 26.6 frac. pixels */
  1256. FT_Pos descender; /* descender in 26.6 frac. pixels */
  1257. FT_Pos height; /* text height in 26.6 frac. pixels */
  1258. FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
  1259. } FT_Size_Metrics;
  1260. /*************************************************************************/
  1261. /* */
  1262. /* <Struct> */
  1263. /* FT_SizeRec */
  1264. /* */
  1265. /* <Description> */
  1266. /* FreeType root size class structure. A size object models a face */
  1267. /* object at a given size. */
  1268. /* */
  1269. /* <Fields> */
  1270. /* face :: Handle to the parent face object. */
  1271. /* */
  1272. /* generic :: A typeless pointer, which is unused by the FreeType */
  1273. /* library or any of its drivers. It can be used by */
  1274. /* client applications to link their own data to each size */
  1275. /* object. */
  1276. /* */
  1277. /* metrics :: Metrics for this size object. This field is read-only. */
  1278. /* */
  1279. typedef struct FT_SizeRec_
  1280. {
  1281. FT_Face face; /* parent face object */
  1282. FT_Generic generic; /* generic pointer for client uses */
  1283. FT_Size_Metrics metrics; /* size metrics */
  1284. FT_Size_Internal internal;
  1285. } FT_SizeRec;
  1286. /*************************************************************************/
  1287. /* */
  1288. /* <Struct> */
  1289. /* FT_SubGlyph */
  1290. /* */
  1291. /* <Description> */
  1292. /* The subglyph structure is an internal object used to describe */
  1293. /* subglyphs (for example, in the case of composites). */
  1294. /* */
  1295. /* <Note> */
  1296. /* The subglyph implementation is not part of the high-level API, */
  1297. /* hence the forward structure declaration. */
  1298. /* */
  1299. /* You can however retrieve subglyph information with */
  1300. /* @FT_Get_SubGlyph_Info. */
  1301. /* */
  1302. typedef struct FT_SubGlyphRec_* FT_SubGlyph;
  1303. /*************************************************************************/
  1304. /* */
  1305. /* <Type> */
  1306. /* FT_Slot_Internal */
  1307. /* */
  1308. /* <Description> */
  1309. /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
  1310. /* model private data of a given @FT_GlyphSlot object. */
  1311. /* */
  1312. typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
  1313. /*************************************************************************/
  1314. /* */
  1315. /* <Struct> */
  1316. /* FT_GlyphSlotRec */
  1317. /* */
  1318. /* <Description> */
  1319. /* FreeType root glyph slot class structure. A glyph slot is a */
  1320. /* container where individual glyphs can be loaded, be they in */
  1321. /* outline or bitmap format. */
  1322. /* */
  1323. /* <Fields> */
  1324. /* library :: A handle to the FreeType library instance */
  1325. /* this slot belongs to. */
  1326. /* */
  1327. /* face :: A handle to the parent face object. */
  1328. /* */
  1329. /* next :: In some cases (like some font tools), several */
  1330. /* glyph slots per face object can be a good */
  1331. /* thing. As this is rare, the glyph slots are */
  1332. /* listed through a direct, single-linked list */
  1333. /* using its `next' field. */
  1334. /* */
  1335. /* generic :: A typeless pointer which is unused by the */
  1336. /* FreeType library or any of its drivers. It */
  1337. /* can be used by client applications to link */
  1338. /* their own data to each glyph slot object. */
  1339. /* */
  1340. /* metrics :: The metrics of the last loaded glyph in the */
  1341. /* slot. The returned values depend on the last */
  1342. /* load flags (see the @FT_Load_Glyph API */
  1343. /* function) and can be expressed either in 26.6 */
  1344. /* fractional pixels or font units. */
  1345. /* */
  1346. /* Note that even when the glyph image is */
  1347. /* transformed, the metrics are not. */
  1348. /* */
  1349. /* linearHoriAdvance :: The advance width of the unhinted glyph. */
  1350. /* Its value is expressed in 16.16 fractional */
  1351. /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
  1352. /* when loading the glyph. This field can be */
  1353. /* important to perform correct WYSIWYG layout. */
  1354. /* Only relevant for outline glyphs. */
  1355. /* */
  1356. /* linearVertAdvance :: The advance height of the unhinted glyph. */
  1357. /* Its value is expressed in 16.16 fractional */
  1358. /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
  1359. /* when loading the glyph. This field can be */
  1360. /* important to perform correct WYSIWYG layout. */
  1361. /* Only relevant for outline glyphs. */
  1362. /* */
  1363. /* advance :: This shorthand is, depending on */
  1364. /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
  1365. /* advance width for the glyph (in 26.6 */
  1366. /* fractional pixel format). As specified with */
  1367. /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
  1368. /* `horiAdvance' or the `vertAdvance' value of */
  1369. /* `metrics' field. */
  1370. /* */
  1371. /* format :: This field indicates the format of the image */
  1372. /* contained in the glyph slot. Typically */
  1373. /* @FT_GLYPH_FORMAT_BITMAP, */
  1374. /* @FT_GLYPH_FORMAT_OUTLINE, or */
  1375. /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
  1376. /* possible. */
  1377. /* */
  1378. /* bitmap :: This field is used as a bitmap descriptor */
  1379. /* when the slot format is */
  1380. /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
  1381. /* address and content of the bitmap buffer can */
  1382. /* change between calls of @FT_Load_Glyph and a */
  1383. /* few other functions. */
  1384. /* */
  1385. /* bitmap_left :: This is the bitmap's left bearing expressed */
  1386. /* in integer pixels. Of course, this is only */
  1387. /* valid if the format is */
  1388. /* @FT_GLYPH_FORMAT_BITMAP. */
  1389. /* */
  1390. /* bitmap_top :: This is the bitmap's top bearing expressed in */
  1391. /* integer pixels. Remember that this is the */
  1392. /* distance from the baseline to the top-most */
  1393. /* glyph scanline, upwards y~coordinates being */
  1394. /* *positive*. */
  1395. /* */
  1396. /* outline :: The outline descriptor for the current glyph */
  1397. /* image if its format is */
  1398. /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
  1399. /* loaded, `outline' can be transformed, */
  1400. /* distorted, embolded, etc. However, it must */
  1401. /* not be freed. */
  1402. /* */
  1403. /* num_subglyphs :: The number of subglyphs in a composite glyph. */
  1404. /* This field is only valid for the composite */
  1405. /* glyph format that should normally only be */
  1406. /* loaded with the @FT_LOAD_NO_RECURSE flag. */
  1407. /* For now this is internal to FreeType. */
  1408. /* */
  1409. /* subglyphs :: An array of subglyph descriptors for */
  1410. /* composite glyphs. There are `num_subglyphs' */
  1411. /* elements in there. Currently internal to */
  1412. /* FreeType. */
  1413. /* */
  1414. /* control_data :: Certain font drivers can also return the */
  1415. /* control data for a given glyph image (e.g. */
  1416. /* TrueType bytecode, Type~1 charstrings, etc.). */
  1417. /* This field is a pointer to such data. */
  1418. /* */
  1419. /* control_len :: This is the length in bytes of the control */
  1420. /* data. */
  1421. /* */
  1422. /* other :: Really wicked formats can use this pointer to */
  1423. /* present their own glyph image to client */
  1424. /* applications. Note that the application */
  1425. /* needs to know about the image format. */
  1426. /* */
  1427. /* lsb_delta :: The difference between hinted and unhinted */
  1428. /* left side bearing while autohinting is */
  1429. /* active. Zero otherwise. */
  1430. /* */
  1431. /* rsb_delta :: The difference between hinted and unhinted */
  1432. /* right side bearing while autohinting is */
  1433. /* active. Zero otherwise. */
  1434. /* */
  1435. /* <Note> */
  1436. /* If @FT_Load_Glyph is called with default flags (see */
  1437. /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
  1438. /* its native format (e.g., an outline glyph for TrueType and Type~1 */
  1439. /* formats). */
  1440. /* */
  1441. /* This image can later be converted into a bitmap by calling */
  1442. /* @FT_Render_Glyph. This function finds the current renderer for */
  1443. /* the native image's format, then invokes it. */
  1444. /* */
  1445. /* The renderer is in charge of transforming the native image through */
  1446. /* the slot's face transformation fields, then converting it into a */
  1447. /* bitmap that is returned in `slot->bitmap'. */
  1448. /* */
  1449. /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
  1450. /* to specify the position of the bitmap relative to the current pen */
  1451. /* position (e.g., coordinates (0,0) on the baseline). Of course, */
  1452. /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
  1453. /* */
  1454. /* <Note> */
  1455. /* Here a small pseudo code fragment which shows how to use */
  1456. /* `lsb_delta' and `rsb_delta': */
  1457. /* */
  1458. /* { */
  1459. /* FT_Pos origin_x = 0; */
  1460. /* FT_Pos prev_rsb_delta = 0; */
  1461. /* */
  1462. /* */
  1463. /* for all glyphs do */
  1464. /* <compute kern between current and previous glyph and add it to */
  1465. /* `origin_x'> */
  1466. /* */
  1467. /* <load glyph with `FT_Load_Glyph'> */
  1468. /* */
  1469. /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
  1470. /* origin_x -= 64; */
  1471. /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
  1472. /* origin_x += 64; */
  1473. /* */
  1474. /* prev_rsb_delta = face->glyph->rsb_delta; */
  1475. /* */
  1476. /* <save glyph image, or render glyph, or ...> */
  1477. /* */
  1478. /* origin_x += face->glyph->advance.x; */
  1479. /* endfor */
  1480. /* } */
  1481. /* */
  1482. typedef struct FT_GlyphSlotRec_
  1483. {
  1484. FT_Library library;
  1485. FT_Face face;
  1486. FT_GlyphSlot next;
  1487. FT_UInt reserved; /* retained for binary compatibility */
  1488. FT_Generic generic;
  1489. FT_Glyph_Metrics metrics;
  1490. FT_Fixed linearHoriAdvance;
  1491. FT_Fixed linearVertAdvance;
  1492. FT_Vector advance;
  1493. FT_Glyph_Format format;
  1494. FT_Bitmap bitmap;
  1495. FT_Int bitmap_left;
  1496. FT_Int bitmap_top;
  1497. FT_Outline outline;
  1498. FT_UInt num_subglyphs;
  1499. FT_SubGlyph subglyphs;
  1500. void* control_data;
  1501. long control_len;
  1502. FT_Pos lsb_delta;
  1503. FT_Pos rsb_delta;
  1504. void* other;
  1505. FT_Slot_Internal internal;
  1506. } FT_GlyphSlotRec;
  1507. /*************************************************************************/
  1508. /*************************************************************************/
  1509. /* */
  1510. /* F U N C T I O N S */
  1511. /* */
  1512. /*************************************************************************/
  1513. /*************************************************************************/
  1514. /*************************************************************************/
  1515. /* */
  1516. /* <Function> */
  1517. /* FT_Init_FreeType */
  1518. /* */
  1519. /* <Description> */
  1520. /* Initialize a new FreeType library object. The set of modules */
  1521. /* that are registered by this function is determined at build time. */
  1522. /* */
  1523. /* <Output> */
  1524. /* alibrary :: A handle to a new library object. */
  1525. /* */
  1526. /* <Return> */
  1527. /* FreeType error code. 0~means success. */
  1528. /* */
  1529. /* <Note> */
  1530. /* In case you want to provide your own memory allocating routines, */
  1531. /* use @FT_New_Library instead, followed by a call to */
  1532. /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
  1533. /* */
  1534. /* For multi-threading applications each thread should have its own */
  1535. /* FT_Library object. */
  1536. /* */
  1537. FT_EXPORT( FT_Error )
  1538. FT_Init_FreeType( FT_Library *alibrary );
  1539. /*************************************************************************/
  1540. /* */
  1541. /* <Function> */
  1542. /* FT_Done_FreeType */
  1543. /* */
  1544. /* <Description> */
  1545. /* Destroy a given FreeType library object and all of its children, */
  1546. /* including resources, drivers, faces, sizes, etc. */
  1547. /* */
  1548. /* <Input> */
  1549. /* library :: A handle to the target library object. */
  1550. /* */
  1551. /* <Return> */
  1552. /* FreeType error code. 0~means success. */
  1553. /* */
  1554. FT_EXPORT( FT_Error )
  1555. FT_Done_FreeType( FT_Library library );
  1556. /*************************************************************************/
  1557. /* */
  1558. /* <Enum> */
  1559. /* FT_OPEN_XXX */
  1560. /* */
  1561. /* <Description> */
  1562. /* A list of bit-field constants used within the `flags' field of the */
  1563. /* @FT_Open_Args structure. */
  1564. /* */
  1565. /* <Values> */
  1566. /* FT_OPEN_MEMORY :: This is a memory-based stream. */
  1567. /* */
  1568. /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
  1569. /* */
  1570. /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
  1571. /* name. */
  1572. /* */
  1573. /* FT_OPEN_DRIVER :: Use the `driver' field. */
  1574. /* */
  1575. /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
  1576. /* */
  1577. /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
  1578. /* */
  1579. /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
  1580. /* */
  1581. /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
  1582. /* */
  1583. /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
  1584. /* */
  1585. /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
  1586. /* */
  1587. /* <Note> */
  1588. /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
  1589. /* flags are mutually exclusive. */
  1590. /* */
  1591. #define FT_OPEN_MEMORY 0x1
  1592. #define FT_OPEN_STREAM 0x2
  1593. #define FT_OPEN_PATHNAME 0x4
  1594. #define FT_OPEN_DRIVER 0x8
  1595. #define FT_OPEN_PARAMS 0x10
  1596. #define ft_open_memory FT_OPEN_MEMORY /* deprecated */
  1597. #define ft_open_stream FT_OPEN_STREAM /* deprecated */
  1598. #define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */
  1599. #define ft_open_driver FT_OPEN_DRIVER /* deprecated */
  1600. #define ft_open_params FT_OPEN_PARAMS /* deprecated */
  1601. /*************************************************************************/
  1602. /* */
  1603. /* <Struct> */
  1604. /* FT_Parameter */
  1605. /* */
  1606. /* <Description> */
  1607. /* A simple structure used to pass more or less generic parameters to */
  1608. /* @FT_Open_Face. */
  1609. /* */
  1610. /* <Fields> */
  1611. /* tag :: A four-byte identification tag. */
  1612. /* */
  1613. /* data :: A pointer to the parameter data. */
  1614. /* */
  1615. /* <Note> */
  1616. /* The ID and function of parameters are driver-specific. See the */
  1617. /* various FT_PARAM_TAG_XXX flags for more information. */
  1618. /* */
  1619. typedef struct FT_Parameter_
  1620. {
  1621. FT_ULong tag;
  1622. FT_Pointer data;
  1623. } FT_Parameter;
  1624. /*************************************************************************/
  1625. /* */
  1626. /* <Struct> */
  1627. /* FT_Open_Args */
  1628. /* */
  1629. /* <Description> */
  1630. /* A structure used to indicate how to open a new font file or */
  1631. /* stream. A pointer to such a structure can be used as a parameter */
  1632. /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
  1633. /* */
  1634. /* <Fields> */
  1635. /* flags :: A set of bit flags indicating how to use the */
  1636. /* structure. */
  1637. /* */
  1638. /* memory_base :: The first byte of the file in memory. */
  1639. /* */
  1640. /* memory_size :: The size in bytes of the file in memory. */
  1641. /* */
  1642. /* pathname :: A pointer to an 8-bit file pathname. */
  1643. /* */
  1644. /* stream :: A handle to a source stream object. */
  1645. /* */
  1646. /* driver :: This field is exclusively used by @FT_Open_Face; */
  1647. /* it simply specifies the font driver to use to open */
  1648. /* the face. If set to~0, FreeType tries to load the */
  1649. /* face with each one of the drivers in its list. */
  1650. /* */
  1651. /* num_params :: The number of extra parameters. */
  1652. /* */
  1653. /* params :: Extra parameters passed to the font driver when */
  1654. /* opening a new face. */
  1655. /* */
  1656. /* <Note> */
  1657. /* The stream type is determined by the contents of `flags' which */
  1658. /* are tested in the following order by @FT_Open_Face: */
  1659. /* */
  1660. /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
  1661. /* memory file of `memory_size' bytes, located at `memory_address'. */
  1662. /* The data are are not copied, and the client is responsible for */
  1663. /* releasing and destroying them _after_ the corresponding call to */
  1664. /* @FT_Done_Face. */
  1665. /* */
  1666. /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
  1667. /* custom input stream `stream' is used. */
  1668. /* */
  1669. /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
  1670. /* is a normal file and use `pathname' to open it. */
  1671. /* */
  1672. /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
  1673. /* open the file with the driver whose handler is in `driver'. */
  1674. /* */
  1675. /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
  1676. /* `num_params' and `params' is used. They are ignored otherwise. */
  1677. /* */
  1678. /* Ideally, both the `pathname' and `params' fields should be tagged */
  1679. /* as `const'; this is missing for API backwards compatibility. In */
  1680. /* other words, applications should treat them as read-only. */
  1681. /* */
  1682. typedef struct FT_Open_Args_
  1683. {
  1684. FT_UInt flags;
  1685. const FT_Byte* memory_base;
  1686. FT_Long memory_size;
  1687. FT_String* pathname;
  1688. FT_Stream stream;
  1689. FT_Module driver;
  1690. FT_Int num_params;
  1691. FT_Parameter* params;
  1692. } FT_Open_Args;
  1693. /*************************************************************************/
  1694. /* */
  1695. /* <Function> */
  1696. /* FT_New_Face */
  1697. /* */
  1698. /* <Description> */
  1699. /* This function calls @FT_Open_Face to open a font by its pathname. */
  1700. /* */
  1701. /* <InOut> */
  1702. /* library :: A handle to the library resource. */
  1703. /* */
  1704. /* <Input> */
  1705. /* pathname :: A path to the font file. */
  1706. /* */
  1707. /* face_index :: The index of the face within the font. The first */
  1708. /* face has index~0. */
  1709. /* */
  1710. /* <Output> */
  1711. /* aface :: A handle to a new face object. If `face_index' is */
  1712. /* greater than or equal to zero, it must be non-NULL. */
  1713. /* See @FT_Open_Face for more details. */
  1714. /* */
  1715. /* <Return> */
  1716. /* FreeType error code. 0~means success. */
  1717. /* */
  1718. FT_EXPORT( FT_Error )
  1719. FT_New_Face( FT_Library library,
  1720. const char* filepathname,
  1721. FT_Long face_index,
  1722. FT_Face *aface );
  1723. /*************************************************************************/
  1724. /* */
  1725. /* <Function> */
  1726. /* FT_New_Memory_Face */
  1727. /* */
  1728. /* <Description> */
  1729. /* This function calls @FT_Open_Face to open a font which has been */
  1730. /* loaded into memory. */
  1731. /* */
  1732. /* <InOut> */
  1733. /* library :: A handle to the library resource. */
  1734. /* */
  1735. /* <Input> */
  1736. /* file_base :: A pointer to the beginning of the font data. */
  1737. /* */
  1738. /* file_size :: The size of the memory chunk used by the font data. */
  1739. /* */
  1740. /* face_index :: The index of the face within the font. The first */
  1741. /* face has index~0. */
  1742. /* */
  1743. /* <Output> */
  1744. /* aface :: A handle to a new face object. If `face_index' is */
  1745. /* greater than or equal to zero, it must be non-NULL. */
  1746. /* See @FT_Open_Face for more details. */
  1747. /* */
  1748. /* <Return> */
  1749. /* FreeType error code. 0~means success. */
  1750. /* */
  1751. /* <Note> */
  1752. /* You must not deallocate the memory before calling @FT_Done_Face. */
  1753. /* */
  1754. FT_EXPORT( FT_Error )
  1755. FT_New_Memory_Face( FT_Library library,
  1756. const FT_Byte* file_base,
  1757. FT_Long file_size,
  1758. FT_Long face_index,
  1759. FT_Face *aface );
  1760. /*************************************************************************/
  1761. /* */
  1762. /* <Function> */
  1763. /* FT_Open_Face */
  1764. /* */
  1765. /* <Description> */
  1766. /* Create a face object from a given resource described by */
  1767. /* @FT_Open_Args. */
  1768. /* */
  1769. /* <InOut> */
  1770. /* library :: A handle to the library resource. */
  1771. /* */
  1772. /* <Input> */
  1773. /* args :: A pointer to an `FT_Open_Args' structure which must */
  1774. /* be filled by the caller. */
  1775. /* */
  1776. /* face_index :: The index of the face within the font. The first */
  1777. /* face has index~0. */
  1778. /* */
  1779. /* <Output> */
  1780. /* aface :: A handle to a new face object. If `face_index' is */
  1781. /* greater than or equal to zero, it must be non-NULL. */
  1782. /* See note below. */
  1783. /* */
  1784. /* <Return> */
  1785. /* FreeType error code. 0~means success. */
  1786. /* */
  1787. /* <Note> */
  1788. /* Unlike FreeType 1.x, this function automatically creates a glyph */
  1789. /* slot for the face object which can be accessed directly through */
  1790. /* `face->glyph'. */
  1791. /* */
  1792. /* FT_Open_Face can be used to quickly check whether the font */
  1793. /* format of a given font resource is supported by FreeType. If the */
  1794. /* `face_index' field is negative, the function's return value is~0 */
  1795. /* if the font format is recognized, or non-zero otherwise; */
  1796. /* the function returns a more or less empty face handle in `*aface' */
  1797. /* (if `aface' isn't NULL). The only useful field in this special */
  1798. /* case is `face->num_faces' which gives the number of faces within */
  1799. /* the font file. After examination, the returned @FT_Face structure */
  1800. /* should be deallocated with a call to @FT_Done_Face. */
  1801. /* */
  1802. /* Each new face object created with this function also owns a */
  1803. /* default @FT_Size object, accessible as `face->size'. */
  1804. /* */
  1805. /* One @FT_Library instance can have multiple face objects, this is, */
  1806. /* @FT_Open_Face and its siblings can be called multiple times using */
  1807. /* the same `library' argument. */
  1808. /* */
  1809. /* See the discussion of reference counters in the description of */
  1810. /* @FT_Reference_Face. */
  1811. /* */
  1812. FT_EXPORT( FT_Error )
  1813. FT_Open_Face( FT_Library library,
  1814. const FT_Open_Args* args,
  1815. FT_Long face_index,
  1816. FT_Face *aface );
  1817. /*************************************************************************/
  1818. /* */
  1819. /* <Function> */
  1820. /* FT_Attach_File */
  1821. /* */
  1822. /* <Description> */
  1823. /* This function calls @FT_Attach_Stream to attach a file. */
  1824. /* */
  1825. /* <InOut> */
  1826. /* face :: The target face object. */
  1827. /* */
  1828. /* <Input> */
  1829. /* filepathname :: The pathname. */
  1830. /* */
  1831. /* <Return> */
  1832. /* FreeType error code. 0~means success. */
  1833. /* */
  1834. FT_EXPORT( FT_Error )
  1835. FT_Attach_File( FT_Face face,
  1836. const char* filepathname );
  1837. /*************************************************************************/
  1838. /* */
  1839. /* <Function> */
  1840. /* FT_Attach_Stream */
  1841. /* */
  1842. /* <Description> */
  1843. /* `Attach' data to a face object. Normally, this is used to read */
  1844. /* additional information for the face object. For example, you can */
  1845. /* attach an AFM file that comes with a Type~1 font to get the */
  1846. /* kerning values and other metrics. */
  1847. /* */
  1848. /* <InOut> */
  1849. /* face :: The target face object. */
  1850. /* */
  1851. /* <Input> */
  1852. /* parameters :: A pointer to @FT_Open_Args which must be filled by */
  1853. /* the caller. */
  1854. /* */
  1855. /* <Return> */
  1856. /* FreeType error code. 0~means success. */
  1857. /* */
  1858. /* <Note> */
  1859. /* The meaning of the `attach' (i.e., what really happens when the */
  1860. /* new file is read) is not fixed by FreeType itself. It really */
  1861. /* depends on the font format (and thus the font driver). */
  1862. /* */
  1863. /* Client applications are expected to know what they are doing */
  1864. /* when invoking this function. Most drivers simply do not implement */
  1865. /* file attachments. */
  1866. /* */
  1867. FT_EXPORT( FT_Error )
  1868. FT_Attach_Stream( FT_Face face,
  1869. FT_Open_Args* parameters );
  1870. /*************************************************************************/
  1871. /* */
  1872. /* <Function> */
  1873. /* FT_Reference_Face */
  1874. /* */
  1875. /* <Description> */
  1876. /* A counter gets initialized to~1 at the time an @FT_Face structure */
  1877. /* is created. This function increments the counter. @FT_Done_Face */
  1878. /* then only destroys a face if the counter is~1, otherwise it simply */
  1879. /* decrements the counter. */
  1880. /* */
  1881. /* This function helps in managing life-cycles of structures which */
  1882. /* reference @FT_Face objects. */
  1883. /* */
  1884. /* <Input> */
  1885. /* face :: A handle to a target face object. */
  1886. /* */
  1887. /* <Return> */
  1888. /* FreeType error code. 0~means success. */
  1889. /* */
  1890. /* <Since> */
  1891. /* 2.4.2 */
  1892. /* */
  1893. FT_EXPORT( FT_Error )
  1894. FT_Reference_Face( FT_Face face );
  1895. /*************************************************************************/
  1896. /* */
  1897. /* <Function> */
  1898. /* FT_Done_Face */
  1899. /* */
  1900. /* <Description> */
  1901. /* Discard a given face object, as well as all of its child slots and */
  1902. /* sizes. */
  1903. /* */
  1904. /* <Input> */
  1905. /* face :: A handle to a target face object. */
  1906. /* */
  1907. /* <Return> */
  1908. /* FreeType error code. 0~means success. */
  1909. /* */
  1910. /* <Note> */
  1911. /* See the discussion of reference counters in the description of */
  1912. /* @FT_Reference_Face. */
  1913. /* */
  1914. FT_EXPORT( FT_Error )
  1915. FT_Done_Face( FT_Face face );
  1916. /*************************************************************************/
  1917. /* */
  1918. /* <Function> */
  1919. /* FT_Select_Size */
  1920. /* */
  1921. /* <Description> */
  1922. /* Select a bitmap strike. */
  1923. /* */
  1924. /* <InOut> */
  1925. /* face :: A handle to a target face object. */
  1926. /* */
  1927. /* <Input> */
  1928. /* strike_index :: The index of the bitmap strike in the */
  1929. /* `available_sizes' field of @FT_FaceRec structure. */
  1930. /* */
  1931. /* <Return> */
  1932. /* FreeType error code. 0~means success. */
  1933. /* */
  1934. FT_EXPORT( FT_Error )
  1935. FT_Select_Size( FT_Face face,
  1936. FT_Int strike_index );
  1937. /*************************************************************************/
  1938. /* */
  1939. /* <Enum> */
  1940. /* FT_Size_Request_Type */
  1941. /* */
  1942. /* <Description> */
  1943. /* An enumeration type that lists the supported size request types. */
  1944. /* */
  1945. /* <Values> */
  1946. /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
  1947. /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
  1948. /* used to determine both scaling values. */
  1949. /* */
  1950. /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
  1951. /* The real dimension. The sum of the the `ascender' and (minus */
  1952. /* of) the `descender' fields of @FT_FaceRec are used to determine */
  1953. /* both scaling values. */
  1954. /* */
  1955. /* FT_SIZE_REQUEST_TYPE_BBOX :: */
  1956. /* The font bounding box. The width and height of the `bbox' field */
  1957. /* of @FT_FaceRec are used to determine the horizontal and vertical */
  1958. /* scaling value, respectively. */
  1959. /* */
  1960. /* FT_SIZE_REQUEST_TYPE_CELL :: */
  1961. /* The `max_advance_width' field of @FT_FaceRec is used to */
  1962. /* determine the horizontal scaling value; the vertical scaling */
  1963. /* value is determined the same way as */
  1964. /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
  1965. /* values are set to the smaller one. This type is useful if you */
  1966. /* want to specify the font size for, say, a window of a given */
  1967. /* dimension and 80x24 cells. */
  1968. /* */
  1969. /* FT_SIZE_REQUEST_TYPE_SCALES :: */
  1970. /* Specify the scaling values directly. */
  1971. /* */
  1972. /* <Note> */
  1973. /* The above descriptions only apply to scalable formats. For bitmap */
  1974. /* formats, the behaviour is up to the driver. */
  1975. /* */
  1976. /* See the note section of @FT_Size_Metrics if you wonder how size */
  1977. /* requesting relates to scaling values. */
  1978. /* */
  1979. typedef enum FT_Size_Request_Type_
  1980. {
  1981. FT_SIZE_REQUEST_TYPE_NOMINAL,
  1982. FT_SIZE_REQUEST_TYPE_REAL_DIM,
  1983. FT_SIZE_REQUEST_TYPE_BBOX,
  1984. FT_SIZE_REQUEST_TYPE_CELL,
  1985. FT_SIZE_REQUEST_TYPE_SCALES,
  1986. FT_SIZE_REQUEST_TYPE_MAX
  1987. } FT_Size_Request_Type;
  1988. /*************************************************************************/
  1989. /* */
  1990. /* <Struct> */
  1991. /* FT_Size_RequestRec */
  1992. /* */
  1993. /* <Description> */
  1994. /* A structure used to model a size request. */
  1995. /* */
  1996. /* <Fields> */
  1997. /* type :: See @FT_Size_Request_Type. */
  1998. /* */
  1999. /* width :: The desired width. */
  2000. /* */
  2001. /* height :: The desired height. */
  2002. /* */
  2003. /* horiResolution :: The horizontal resolution. If set to zero, */
  2004. /* `width' is treated as a 26.6 fractional pixel */
  2005. /* value. */
  2006. /* */
  2007. /* vertResolution :: The vertical resolution. If set to zero, */
  2008. /* `height' is treated as a 26.6 fractional pixel */
  2009. /* value. */
  2010. /* */
  2011. /* <Note> */
  2012. /* If `width' is zero, then the horizontal scaling value is set equal */
  2013. /* to the vertical scaling value, and vice versa. */
  2014. /* */
  2015. typedef struct FT_Size_RequestRec_
  2016. {
  2017. FT_Size_Request_Type type;
  2018. FT_Long width;
  2019. FT_Long height;
  2020. FT_UInt horiResolution;
  2021. FT_UInt vertResolution;
  2022. } FT_Size_RequestRec;
  2023. /*************************************************************************/
  2024. /* */
  2025. /* <Struct> */
  2026. /* FT_Size_Request */
  2027. /* */
  2028. /* <Description> */
  2029. /* A handle to a size request structure. */
  2030. /* */
  2031. typedef struct FT_Size_RequestRec_ *FT_Size_Request;
  2032. /*************************************************************************/
  2033. /* */
  2034. /* <Function> */
  2035. /* FT_Request_Size */
  2036. /* */
  2037. /* <Description> */
  2038. /* Resize the scale of the active @FT_Size object in a face. */
  2039. /* */
  2040. /* <InOut> */
  2041. /* face :: A handle to a target face object. */
  2042. /* */
  2043. /* <Input> */
  2044. /* req :: A pointer to a @FT_Size_RequestRec. */
  2045. /* */
  2046. /* <Return> */
  2047. /* FreeType error code. 0~means success. */
  2048. /* */
  2049. /* <Note> */
  2050. /* Although drivers may select the bitmap strike matching the */
  2051. /* request, you should not rely on this if you intend to select a */
  2052. /* particular bitmap strike. Use @FT_Select_Size instead in that */
  2053. /* case. */
  2054. /* */
  2055. /* The relation between the requested size and the resulting glyph */
  2056. /* size is dependent entirely on how the size is defined in the */
  2057. /* source face. The font designer chooses the final size of each */
  2058. /* glyph relative to this size. For more information refer to */
  2059. /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
  2060. /* */
  2061. FT_EXPORT( FT_Error )
  2062. FT_Request_Size( FT_Face face,
  2063. FT_Size_Request req );
  2064. /*************************************************************************/
  2065. /* */
  2066. /* <Function> */
  2067. /* FT_Set_Char_Size */
  2068. /* */
  2069. /* <Description> */
  2070. /* This function calls @FT_Request_Size to request the nominal size */
  2071. /* (in points). */
  2072. /* */
  2073. /* <InOut> */
  2074. /* face :: A handle to a target face object. */
  2075. /* */
  2076. /* <Input> */
  2077. /* char_width :: The nominal width, in 26.6 fractional points. */
  2078. /* */
  2079. /* char_height :: The nominal height, in 26.6 fractional points. */
  2080. /* */
  2081. /* horz_resolution :: The horizontal resolution in dpi. */
  2082. /* */
  2083. /* vert_resolution :: The vertical resolution in dpi. */
  2084. /* */
  2085. /* <Return> */
  2086. /* FreeType error code. 0~means success. */
  2087. /* */
  2088. /* <Note> */
  2089. /* If either the character width or height is zero, it is set equal */
  2090. /* to the other value. */
  2091. /* */
  2092. /* If either the horizontal or vertical resolution is zero, it is set */
  2093. /* equal to the other value. */
  2094. /* */
  2095. /* A character width or height smaller than 1pt is set to 1pt; if */
  2096. /* both resolution values are zero, they are set to 72dpi. */
  2097. /* */
  2098. /* Don't use this function if you are using the FreeType cache API. */
  2099. /* */
  2100. FT_EXPORT( FT_Error )
  2101. FT_Set_Char_Size( FT_Face face,
  2102. FT_F26Dot6 char_width,
  2103. FT_F26Dot6 char_height,
  2104. FT_UInt horz_resolution,
  2105. FT_UInt vert_resolution );
  2106. /*************************************************************************/
  2107. /* */
  2108. /* <Function> */
  2109. /* FT_Set_Pixel_Sizes */
  2110. /* */
  2111. /* <Description> */
  2112. /* This function calls @FT_Request_Size to request the nominal size */
  2113. /* (in pixels). */
  2114. /* */
  2115. /* <InOut> */
  2116. /* face :: A handle to the target face object. */
  2117. /* */
  2118. /* <Input> */
  2119. /* pixel_width :: The nominal width, in pixels. */
  2120. /* */
  2121. /* pixel_height :: The nominal height, in pixels. */
  2122. /* */
  2123. /* <Return> */
  2124. /* FreeType error code. 0~means success. */
  2125. /* */
  2126. /* <Note> */
  2127. /* You should not rely on the resulting glyphs matching, or being */
  2128. /* constrained, to this pixel size. Refer to @FT_Request_Size to */
  2129. /* understand how requested sizes relate to actual sizes. */
  2130. /* */
  2131. FT_EXPORT( FT_Error )
  2132. FT_Set_Pixel_Sizes( FT_Face face,
  2133. FT_UInt pixel_width,
  2134. FT_UInt pixel_height );
  2135. /*************************************************************************/
  2136. /* */
  2137. /* <Function> */
  2138. /* FT_Load_Glyph */
  2139. /* */
  2140. /* <Description> */
  2141. /* A function used to load a single glyph into the glyph slot of a */
  2142. /* face object. */
  2143. /* */
  2144. /* <InOut> */
  2145. /* face :: A handle to the target face object where the glyph */
  2146. /* is loaded. */
  2147. /* */
  2148. /* <Input> */
  2149. /* glyph_index :: The index of the glyph in the font file. For */
  2150. /* CID-keyed fonts (either in PS or in CFF format) */
  2151. /* this argument specifies the CID value. */
  2152. /* */
  2153. /* load_flags :: A flag indicating what to load for this glyph. The */
  2154. /* @FT_LOAD_XXX constants can be used to control the */
  2155. /* glyph loading process (e.g., whether the outline */
  2156. /* should be scaled, whether to load bitmaps or not, */
  2157. /* whether to hint the outline, etc). */
  2158. /* */
  2159. /* <Return> */
  2160. /* FreeType error code. 0~means success. */
  2161. /* */
  2162. /* <Note> */
  2163. /* The loaded glyph may be transformed. See @FT_Set_Transform for */
  2164. /* the details. */
  2165. /* */
  2166. /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
  2167. /* returned for invalid CID values (this is, for CID values which */
  2168. /* don't have a corresponding glyph in the font). See the discussion */
  2169. /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
  2170. /* */
  2171. FT_EXPORT( FT_Error )
  2172. FT_Load_Glyph( FT_Face face,
  2173. FT_UInt glyph_index,
  2174. FT_Int32 load_flags );
  2175. /*************************************************************************/
  2176. /* */
  2177. /* <Function> */
  2178. /* FT_Load_Char */
  2179. /* */
  2180. /* <Description> */
  2181. /* A function used to load a single glyph into the glyph slot of a */
  2182. /* face object, according to its character code. */
  2183. /* */
  2184. /* <InOut> */
  2185. /* face :: A handle to a target face object where the glyph */
  2186. /* is loaded. */
  2187. /* */
  2188. /* <Input> */
  2189. /* char_code :: The glyph's character code, according to the */
  2190. /* current charmap used in the face. */
  2191. /* */
  2192. /* load_flags :: A flag indicating what to load for this glyph. The */
  2193. /* @FT_LOAD_XXX constants can be used to control the */
  2194. /* glyph loading process (e.g., whether the outline */
  2195. /* should be scaled, whether to load bitmaps or not, */
  2196. /* whether to hint the outline, etc). */
  2197. /* */
  2198. /* <Return> */
  2199. /* FreeType error code. 0~means success. */
  2200. /* */
  2201. /* <Note> */
  2202. /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
  2203. /* */
  2204. FT_EXPORT( FT_Error )
  2205. FT_Load_Char( FT_Face face,
  2206. FT_ULong char_code,
  2207. FT_Int32 load_flags );
  2208. /*************************************************************************
  2209. *
  2210. * @enum:
  2211. * FT_LOAD_XXX
  2212. *
  2213. * @description:
  2214. * A list of bit-field constants used with @FT_Load_Glyph to indicate
  2215. * what kind of operations to perform during glyph loading.
  2216. *
  2217. * @values:
  2218. * FT_LOAD_DEFAULT ::
  2219. * Corresponding to~0, this value is used as the default glyph load
  2220. * operation. In this case, the following happens:
  2221. *
  2222. * 1. FreeType looks for a bitmap for the glyph corresponding to the
  2223. * face's current size. If one is found, the function returns.
  2224. * The bitmap data can be accessed from the glyph slot (see note
  2225. * below).
  2226. *
  2227. * 2. If no embedded bitmap is searched or found, FreeType looks for a
  2228. * scalable outline. If one is found, it is loaded from the font
  2229. * file, scaled to device pixels, then `hinted' to the pixel grid
  2230. * in order to optimize it. The outline data can be accessed from
  2231. * the glyph slot (see note below).
  2232. *
  2233. * Note that by default, the glyph loader doesn't render outlines into
  2234. * bitmaps. The following flags are used to modify this default
  2235. * behaviour to more specific and useful cases.
  2236. *
  2237. * FT_LOAD_NO_SCALE ::
  2238. * Don't scale the loaded outline glyph but keep it in font units.
  2239. *
  2240. * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
  2241. * unsets @FT_LOAD_RENDER.
  2242. *
  2243. * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
  2244. * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
  2245. * subglyphs must be scaled and positioned with hinting instructions.
  2246. * This can be solved by loading the font without FT_LOAD_NO_SCALE and
  2247. * setting the character size to `font->units_per_EM'.
  2248. *
  2249. * FT_LOAD_NO_HINTING ::
  2250. * Disable hinting. This generally generates `blurrier' bitmap glyphs
  2251. * when the glyph are rendered in any of the anti-aliased modes. See
  2252. * also the note below.
  2253. *
  2254. * This flag is implied by @FT_LOAD_NO_SCALE.
  2255. *
  2256. * FT_LOAD_RENDER ::
  2257. * Call @FT_Render_Glyph after the glyph is loaded. By default, the
  2258. * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
  2259. * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
  2260. *
  2261. * This flag is unset by @FT_LOAD_NO_SCALE.
  2262. *
  2263. * FT_LOAD_NO_BITMAP ::
  2264. * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
  2265. * flag.
  2266. *
  2267. * @FT_LOAD_NO_SCALE always sets this flag.
  2268. *
  2269. * FT_LOAD_VERTICAL_LAYOUT ::
  2270. * Load the glyph for vertical text layout. In particular, the
  2271. * `advance' value in the @FT_GlyphSlotRec structure is set to the
  2272. * `vertAdvance' value of the `metrics' field.
  2273. *
  2274. * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
  2275. * this flag currently. Reason is that in this case vertical metrics
  2276. * get synthesized, and those values are not always consistent across
  2277. * various font formats.
  2278. *
  2279. * FT_LOAD_FORCE_AUTOHINT ::
  2280. * Indicates that the auto-hinter is preferred over the font's native
  2281. * hinter. See also the note below.
  2282. *
  2283. * FT_LOAD_CROP_BITMAP ::
  2284. * Indicates that the font driver should crop the loaded bitmap glyph
  2285. * (i.e., remove all space around its black bits). Not all drivers
  2286. * implement this.
  2287. *
  2288. * FT_LOAD_PEDANTIC ::
  2289. * Indicates that the font driver should perform pedantic verifications
  2290. * during glyph loading. This is mostly used to detect broken glyphs
  2291. * in fonts. By default, FreeType tries to handle broken fonts also.
  2292. *
  2293. * In particular, errors from the TrueType bytecode engine are not
  2294. * passed to the application if this flag is not set; this might
  2295. * result in partially hinted or distorted glyphs in case a glyph's
  2296. * bytecode is buggy.
  2297. *
  2298. * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
  2299. * Ignored. Deprecated.
  2300. *
  2301. * FT_LOAD_NO_RECURSE ::
  2302. * This flag is only used internally. It merely indicates that the
  2303. * font driver should not load composite glyphs recursively. Instead,
  2304. * it should set the `num_subglyph' and `subglyphs' values of the
  2305. * glyph slot accordingly, and set `glyph->format' to
  2306. * @FT_GLYPH_FORMAT_COMPOSITE.
  2307. *
  2308. * The description of sub-glyphs is not available to client
  2309. * applications for now.
  2310. *
  2311. * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
  2312. *
  2313. * FT_LOAD_IGNORE_TRANSFORM ::
  2314. * Indicates that the transform matrix set by @FT_Set_Transform should
  2315. * be ignored.
  2316. *
  2317. * FT_LOAD_MONOCHROME ::
  2318. * This flag is used with @FT_LOAD_RENDER to indicate that you want to
  2319. * render an outline glyph to a 1-bit monochrome bitmap glyph, with
  2320. * 8~pixels packed into each byte of the bitmap data.
  2321. *
  2322. * Note that this has no effect on the hinting algorithm used. You
  2323. * should rather use @FT_LOAD_TARGET_MONO so that the
  2324. * monochrome-optimized hinting algorithm is used.
  2325. *
  2326. * FT_LOAD_LINEAR_DESIGN ::
  2327. * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
  2328. * fields of @FT_GlyphSlotRec should be kept in font units. See
  2329. * @FT_GlyphSlotRec for details.
  2330. *
  2331. * FT_LOAD_NO_AUTOHINT ::
  2332. * Disable auto-hinter. See also the note below.
  2333. *
  2334. * @note:
  2335. * By default, hinting is enabled and the font's native hinter (see
  2336. * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
  2337. * disable hinting by setting @FT_LOAD_NO_HINTING or change the
  2338. * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
  2339. * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
  2340. * used at all.
  2341. *
  2342. * See the description of @FT_FACE_FLAG_TRICKY for a special exception
  2343. * (affecting only a handful of Asian fonts).
  2344. *
  2345. * Besides deciding which hinter to use, you can also decide which
  2346. * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
  2347. *
  2348. * Note that the auto-hinter needs a valid Unicode cmap (either a native
  2349. * one or synthesized by FreeType) for producing correct results. If a
  2350. * font provides an incorrect mapping (for example, assigning the
  2351. * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
  2352. * mathematical integral sign), the auto-hinter might produce useless
  2353. * results.
  2354. *
  2355. */
  2356. #define FT_LOAD_DEFAULT 0x0
  2357. #define FT_LOAD_NO_SCALE ( 1L << 0 )
  2358. #define FT_LOAD_NO_HINTING ( 1L << 1 )
  2359. #define FT_LOAD_RENDER ( 1L << 2 )
  2360. #define FT_LOAD_NO_BITMAP ( 1L << 3 )
  2361. #define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
  2362. #define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
  2363. #define FT_LOAD_CROP_BITMAP ( 1L << 6 )
  2364. #define FT_LOAD_PEDANTIC ( 1L << 7 )
  2365. #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
  2366. #define FT_LOAD_NO_RECURSE ( 1L << 10 )
  2367. #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
  2368. #define FT_LOAD_MONOCHROME ( 1L << 12 )
  2369. #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
  2370. #define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
  2371. /* */
  2372. /* used internally only by certain font drivers! */
  2373. #define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
  2374. #define FT_LOAD_SBITS_ONLY ( 1L << 14 )
  2375. /**************************************************************************
  2376. *
  2377. * @enum:
  2378. * FT_LOAD_TARGET_XXX
  2379. *
  2380. * @description:
  2381. * A list of values that are used to select a specific hinting algorithm
  2382. * to use by the hinter. You should OR one of these values to your
  2383. * `load_flags' when calling @FT_Load_Glyph.
  2384. *
  2385. * Note that font's native hinters may ignore the hinting algorithm you
  2386. * have specified (e.g., the TrueType bytecode interpreter). You can set
  2387. * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
  2388. *
  2389. * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
  2390. * always implies @FT_LOAD_FORCE_AUTOHINT.
  2391. *
  2392. * @values:
  2393. * FT_LOAD_TARGET_NORMAL ::
  2394. * This corresponds to the default hinting algorithm, optimized for
  2395. * standard gray-level rendering. For monochrome output, use
  2396. * @FT_LOAD_TARGET_MONO instead.
  2397. *
  2398. * FT_LOAD_TARGET_LIGHT ::
  2399. * A lighter hinting algorithm for non-monochrome modes. Many
  2400. * generated glyphs are more fuzzy but better resemble its original
  2401. * shape. A bit like rendering on Mac OS~X.
  2402. *
  2403. * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
  2404. *
  2405. * FT_LOAD_TARGET_MONO ::
  2406. * Strong hinting algorithm that should only be used for monochrome
  2407. * output. The result is probably unpleasant if the glyph is rendered
  2408. * in non-monochrome modes.
  2409. *
  2410. * FT_LOAD_TARGET_LCD ::
  2411. * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
  2412. * decimated LCD displays.
  2413. *
  2414. * FT_LOAD_TARGET_LCD_V ::
  2415. * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
  2416. * decimated LCD displays.
  2417. *
  2418. * @note:
  2419. * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
  2420. * `load_flags'. They can't be ORed.
  2421. *
  2422. * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
  2423. * corresponding mode (i.e., the mode which matches the used algorithm
  2424. * best). An exeption is FT_LOAD_TARGET_MONO since it implies
  2425. * @FT_LOAD_MONOCHROME.
  2426. *
  2427. * You can use a hinting algorithm that doesn't correspond to the same
  2428. * rendering mode. As an example, it is possible to use the `light'
  2429. * hinting algorithm and have the results rendered in horizontal LCD
  2430. * pixel mode, with code like
  2431. *
  2432. * {
  2433. * FT_Load_Glyph( face, glyph_index,
  2434. * load_flags | FT_LOAD_TARGET_LIGHT );
  2435. *
  2436. * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
  2437. * }
  2438. *
  2439. */
  2440. #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
  2441. #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
  2442. #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
  2443. #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
  2444. #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
  2445. #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
  2446. /**************************************************************************
  2447. *
  2448. * @macro:
  2449. * FT_LOAD_TARGET_MODE
  2450. *
  2451. * @description:
  2452. * Return the @FT_Render_Mode corresponding to a given
  2453. * @FT_LOAD_TARGET_XXX value.
  2454. *
  2455. */
  2456. #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
  2457. /*************************************************************************/
  2458. /* */
  2459. /* <Function> */
  2460. /* FT_Set_Transform */
  2461. /* */
  2462. /* <Description> */
  2463. /* A function used to set the transformation that is applied to glyph */
  2464. /* images when they are loaded into a glyph slot through */
  2465. /* @FT_Load_Glyph. */
  2466. /* */
  2467. /* <InOut> */
  2468. /* face :: A handle to the source face object. */
  2469. /* */
  2470. /* <Input> */
  2471. /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
  2472. /* the identity matrix. */
  2473. /* delta :: A pointer to the translation vector. Use~0 for the null */
  2474. /* vector. */
  2475. /* */
  2476. /* <Note> */
  2477. /* The transformation is only applied to scalable image formats after */
  2478. /* the glyph has been loaded. It means that hinting is unaltered by */
  2479. /* the transformation and is performed on the character size given in */
  2480. /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
  2481. /* */
  2482. /* Note that this also transforms the `face.glyph.advance' field, but */
  2483. /* *not* the values in `face.glyph.metrics'. */
  2484. /* */
  2485. FT_EXPORT( void )
  2486. FT_Set_Transform( FT_Face face,
  2487. FT_Matrix* matrix,
  2488. FT_Vector* delta );
  2489. /*************************************************************************/
  2490. /* */
  2491. /* <Enum> */
  2492. /* FT_Render_Mode */
  2493. /* */
  2494. /* <Description> */
  2495. /* An enumeration type that lists the render modes supported by */
  2496. /* FreeType~2. Each mode corresponds to a specific type of scanline */
  2497. /* conversion performed on the outline. */
  2498. /* */
  2499. /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
  2500. /* field in the @FT_GlyphSlotRec structure gives the format of the */
  2501. /* returned bitmap. */
  2502. /* */
  2503. /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
  2504. /* */
  2505. /* <Values> */
  2506. /* FT_RENDER_MODE_NORMAL :: */
  2507. /* This is the default render mode; it corresponds to 8-bit */
  2508. /* anti-aliased bitmaps. */
  2509. /* */
  2510. /* FT_RENDER_MODE_LIGHT :: */
  2511. /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
  2512. /* defined as a separate value because render modes are also used */
  2513. /* indirectly to define hinting algorithm selectors. See */
  2514. /* @FT_LOAD_TARGET_XXX for details. */
  2515. /* */
  2516. /* FT_RENDER_MODE_MONO :: */
  2517. /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
  2518. /* opacity). */
  2519. /* */
  2520. /* FT_RENDER_MODE_LCD :: */
  2521. /* This mode corresponds to horizontal RGB and BGR sub-pixel */
  2522. /* displays like LCD screens. It produces 8-bit bitmaps that are */
  2523. /* 3~times the width of the original glyph outline in pixels, and */
  2524. /* which use the @FT_PIXEL_MODE_LCD mode. */
  2525. /* */
  2526. /* FT_RENDER_MODE_LCD_V :: */
  2527. /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
  2528. /* (like PDA screens, rotated LCD displays, etc.). It produces */
  2529. /* 8-bit bitmaps that are 3~times the height of the original */
  2530. /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
  2531. /* */
  2532. /* <Note> */
  2533. /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
  2534. /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
  2535. /* (not active in the default builds). It is up to the caller to */
  2536. /* either call @FT_Library_SetLcdFilter (if available) or do the */
  2537. /* filtering itself. */
  2538. /* */
  2539. /* The selected render mode only affects vector glyphs of a font. */
  2540. /* Embedded bitmaps often have a different pixel mode like */
  2541. /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
  2542. /* them into 8-bit pixmaps. */
  2543. /* */
  2544. typedef enum FT_Render_Mode_
  2545. {
  2546. FT_RENDER_MODE_NORMAL = 0,
  2547. FT_RENDER_MODE_LIGHT,
  2548. FT_RENDER_MODE_MONO,
  2549. FT_RENDER_MODE_LCD,
  2550. FT_RENDER_MODE_LCD_V,
  2551. FT_RENDER_MODE_MAX
  2552. } FT_Render_Mode;
  2553. /*************************************************************************/
  2554. /* */
  2555. /* <Enum> */
  2556. /* ft_render_mode_xxx */
  2557. /* */
  2558. /* <Description> */
  2559. /* These constants are deprecated. Use the corresponding */
  2560. /* @FT_Render_Mode values instead. */
  2561. /* */
  2562. /* <Values> */
  2563. /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
  2564. /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
  2565. /* */
  2566. #define ft_render_mode_normal FT_RENDER_MODE_NORMAL
  2567. #define ft_render_mode_mono FT_RENDER_MODE_MONO
  2568. /*************************************************************************/
  2569. /* */
  2570. /* <Function> */
  2571. /* FT_Render_Glyph */
  2572. /* */
  2573. /* <Description> */
  2574. /* Convert a given glyph image to a bitmap. It does so by inspecting */
  2575. /* the glyph image format, finding the relevant renderer, and */
  2576. /* invoking it. */
  2577. /* */
  2578. /* <InOut> */
  2579. /* slot :: A handle to the glyph slot containing the image to */
  2580. /* convert. */
  2581. /* */
  2582. /* <Input> */
  2583. /* render_mode :: This is the render mode used to render the glyph */
  2584. /* image into a bitmap. See @FT_Render_Mode for a */
  2585. /* list of possible values. */
  2586. /* */
  2587. /* <Return> */
  2588. /* FreeType error code. 0~means success. */
  2589. /* */
  2590. FT_EXPORT( FT_Error )
  2591. FT_Render_Glyph( FT_GlyphSlot slot,
  2592. FT_Render_Mode render_mode );
  2593. /*************************************************************************/
  2594. /* */
  2595. /* <Enum> */
  2596. /* FT_Kerning_Mode */
  2597. /* */
  2598. /* <Description> */
  2599. /* An enumeration used to specify which kerning values to return in */
  2600. /* @FT_Get_Kerning. */
  2601. /* */
  2602. /* <Values> */
  2603. /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
  2604. /* distances (value is~0). */
  2605. /* */
  2606. /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
  2607. /* distances. */
  2608. /* */
  2609. /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
  2610. /* units. */
  2611. /* */
  2612. typedef enum FT_Kerning_Mode_
  2613. {
  2614. FT_KERNING_DEFAULT = 0,
  2615. FT_KERNING_UNFITTED,
  2616. FT_KERNING_UNSCALED
  2617. } FT_Kerning_Mode;
  2618. /*************************************************************************/
  2619. /* */
  2620. /* <Const> */
  2621. /* ft_kerning_default */
  2622. /* */
  2623. /* <Description> */
  2624. /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
  2625. /* instead. */
  2626. /* */
  2627. #define ft_kerning_default FT_KERNING_DEFAULT
  2628. /*************************************************************************/
  2629. /* */
  2630. /* <Const> */
  2631. /* ft_kerning_unfitted */
  2632. /* */
  2633. /* <Description> */
  2634. /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
  2635. /* instead. */
  2636. /* */
  2637. #define ft_kerning_unfitted FT_KERNING_UNFITTED
  2638. /*************************************************************************/
  2639. /* */
  2640. /* <Const> */
  2641. /* ft_kerning_unscaled */
  2642. /* */
  2643. /* <Description> */
  2644. /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
  2645. /* instead. */
  2646. /* */
  2647. #define ft_kerning_unscaled FT_KERNING_UNSCALED
  2648. /*************************************************************************/
  2649. /* */
  2650. /* <Function> */
  2651. /* FT_Get_Kerning */
  2652. /* */
  2653. /* <Description> */
  2654. /* Return the kerning vector between two glyphs of a same face. */
  2655. /* */
  2656. /* <Input> */
  2657. /* face :: A handle to a source face object. */
  2658. /* */
  2659. /* left_glyph :: The index of the left glyph in the kern pair. */
  2660. /* */
  2661. /* right_glyph :: The index of the right glyph in the kern pair. */
  2662. /* */
  2663. /* kern_mode :: See @FT_Kerning_Mode for more information. */
  2664. /* Determines the scale and dimension of the returned */
  2665. /* kerning vector. */
  2666. /* */
  2667. /* <Output> */
  2668. /* akerning :: The kerning vector. This is either in font units */
  2669. /* or in pixels (26.6 format) for scalable formats, */
  2670. /* and in pixels for fixed-sizes formats. */
  2671. /* */
  2672. /* <Return> */
  2673. /* FreeType error code. 0~means success. */
  2674. /* */
  2675. /* <Note> */
  2676. /* Only horizontal layouts (left-to-right & right-to-left) are */
  2677. /* supported by this method. Other layouts, or more sophisticated */
  2678. /* kernings, are out of the scope of this API function -- they can be */
  2679. /* implemented through format-specific interfaces. */
  2680. /* */
  2681. FT_EXPORT( FT_Error )
  2682. FT_Get_Kerning( FT_Face face,
  2683. FT_UInt left_glyph,
  2684. FT_UInt right_glyph,
  2685. FT_UInt kern_mode,
  2686. FT_Vector *akerning );
  2687. /*************************************************************************/
  2688. /* */
  2689. /* <Function> */
  2690. /* FT_Get_Track_Kerning */
  2691. /* */
  2692. /* <Description> */
  2693. /* Return the track kerning for a given face object at a given size. */
  2694. /* */
  2695. /* <Input> */
  2696. /* face :: A handle to a source face object. */
  2697. /* */
  2698. /* point_size :: The point size in 16.16 fractional points. */
  2699. /* */
  2700. /* degree :: The degree of tightness. Increasingly negative */
  2701. /* values represent tighter track kerning, while */
  2702. /* increasingly positive values represent looser track */
  2703. /* kerning. Value zero means no track kerning. */
  2704. /* */
  2705. /* <Output> */
  2706. /* akerning :: The kerning in 16.16 fractional points, to be */
  2707. /* uniformly applied between all glyphs. */
  2708. /* */
  2709. /* <Return> */
  2710. /* FreeType error code. 0~means success. */
  2711. /* */
  2712. /* <Note> */
  2713. /* Currently, only the Type~1 font driver supports track kerning, */
  2714. /* using data from AFM files (if attached with @FT_Attach_File or */
  2715. /* @FT_Attach_Stream). */
  2716. /* */
  2717. /* Only very few AFM files come with track kerning data; please refer */
  2718. /* to the Adobe's AFM specification for more details. */
  2719. /* */
  2720. FT_EXPORT( FT_Error )
  2721. FT_Get_Track_Kerning( FT_Face face,
  2722. FT_Fixed point_size,
  2723. FT_Int degree,
  2724. FT_Fixed* akerning );
  2725. /*************************************************************************/
  2726. /* */
  2727. /* <Function> */
  2728. /* FT_Get_Glyph_Name */
  2729. /* */
  2730. /* <Description> */
  2731. /* Retrieve the ASCII name of a given glyph in a face. This only */
  2732. /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
  2733. /* */
  2734. /* <Input> */
  2735. /* face :: A handle to a source face object. */
  2736. /* */
  2737. /* glyph_index :: The glyph index. */
  2738. /* */
  2739. /* buffer_max :: The maximum number of bytes available in the */
  2740. /* buffer. */
  2741. /* */
  2742. /* <Output> */
  2743. /* buffer :: A pointer to a target buffer where the name is */
  2744. /* copied to. */
  2745. /* */
  2746. /* <Return> */
  2747. /* FreeType error code. 0~means success. */
  2748. /* */
  2749. /* <Note> */
  2750. /* An error is returned if the face doesn't provide glyph names or if */
  2751. /* the glyph index is invalid. In all cases of failure, the first */
  2752. /* byte of `buffer' is set to~0 to indicate an empty name. */
  2753. /* */
  2754. /* The glyph name is truncated to fit within the buffer if it is too */
  2755. /* long. The returned string is always zero-terminated. */
  2756. /* */
  2757. /* Be aware that FreeType reorders glyph indices internally so that */
  2758. /* glyph index~0 always corresponds to the `missing glyph' (called */
  2759. /* `.notdef'). */
  2760. /* */
  2761. /* This function is not compiled within the library if the config */
  2762. /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
  2763. /* `include/freetype/config/ftoptions.h'. */
  2764. /* */
  2765. FT_EXPORT( FT_Error )
  2766. FT_Get_Glyph_Name( FT_Face face,
  2767. FT_UInt glyph_index,
  2768. FT_Pointer buffer,
  2769. FT_UInt buffer_max );
  2770. /*************************************************************************/
  2771. /* */
  2772. /* <Function> */
  2773. /* FT_Get_Postscript_Name */
  2774. /* */
  2775. /* <Description> */
  2776. /* Retrieve the ASCII PostScript name of a given face, if available. */
  2777. /* This only works with PostScript and TrueType fonts. */
  2778. /* */
  2779. /* <Input> */
  2780. /* face :: A handle to the source face object. */
  2781. /* */
  2782. /* <Return> */
  2783. /* A pointer to the face's PostScript name. NULL if unavailable. */
  2784. /* */
  2785. /* <Note> */
  2786. /* The returned pointer is owned by the face and is destroyed with */
  2787. /* it. */
  2788. /* */
  2789. FT_EXPORT( const char* )
  2790. FT_Get_Postscript_Name( FT_Face face );
  2791. /*************************************************************************/
  2792. /* */
  2793. /* <Function> */
  2794. /* FT_Select_Charmap */
  2795. /* */
  2796. /* <Description> */
  2797. /* Select a given charmap by its encoding tag (as listed in */
  2798. /* `freetype.h'). */
  2799. /* */
  2800. /* <InOut> */
  2801. /* face :: A handle to the source face object. */
  2802. /* */
  2803. /* <Input> */
  2804. /* encoding :: A handle to the selected encoding. */
  2805. /* */
  2806. /* <Return> */
  2807. /* FreeType error code. 0~means success. */
  2808. /* */
  2809. /* <Note> */
  2810. /* This function returns an error if no charmap in the face */
  2811. /* corresponds to the encoding queried here. */
  2812. /* */
  2813. /* Because many fonts contain more than a single cmap for Unicode */
  2814. /* encoding, this function has some special code to select the one */
  2815. /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
  2816. /* is preferred to a UCS-2 cmap). It is thus preferable to */
  2817. /* @FT_Set_Charmap in this case. */
  2818. /* */
  2819. FT_EXPORT( FT_Error )
  2820. FT_Select_Charmap( FT_Face face,
  2821. FT_Encoding encoding );
  2822. /*************************************************************************/
  2823. /* */
  2824. /* <Function> */
  2825. /* FT_Set_Charmap */
  2826. /* */
  2827. /* <Description> */
  2828. /* Select a given charmap for character code to glyph index mapping. */
  2829. /* */
  2830. /* <InOut> */
  2831. /* face :: A handle to the source face object. */
  2832. /* */
  2833. /* <Input> */
  2834. /* charmap :: A handle to the selected charmap. */
  2835. /* */
  2836. /* <Return> */
  2837. /* FreeType error code. 0~means success. */
  2838. /* */
  2839. /* <Note> */
  2840. /* This function returns an error if the charmap is not part of */
  2841. /* the face (i.e., if it is not listed in the `face->charmaps' */
  2842. /* table). */
  2843. /* */
  2844. /* It also fails if a type~14 charmap is selected. */
  2845. /* */
  2846. FT_EXPORT( FT_Error )
  2847. FT_Set_Charmap( FT_Face face,
  2848. FT_CharMap charmap );
  2849. /*************************************************************************
  2850. *
  2851. * @function:
  2852. * FT_Get_Charmap_Index
  2853. *
  2854. * @description:
  2855. * Retrieve index of a given charmap.
  2856. *
  2857. * @input:
  2858. * charmap ::
  2859. * A handle to a charmap.
  2860. *
  2861. * @return:
  2862. * The index into the array of character maps within the face to which
  2863. * `charmap' belongs. If an error occurs, -1 is returned.
  2864. *
  2865. */
  2866. FT_EXPORT( FT_Int )
  2867. FT_Get_Charmap_Index( FT_CharMap charmap );
  2868. /*************************************************************************/
  2869. /* */
  2870. /* <Function> */
  2871. /* FT_Get_Char_Index */
  2872. /* */
  2873. /* <Description> */
  2874. /* Return the glyph index of a given character code. This function */
  2875. /* uses a charmap object to do the mapping. */
  2876. /* */
  2877. /* <Input> */
  2878. /* face :: A handle to the source face object. */
  2879. /* */
  2880. /* charcode :: The character code. */
  2881. /* */
  2882. /* <Return> */
  2883. /* The glyph index. 0~means `undefined character code'. */
  2884. /* */
  2885. /* <Note> */
  2886. /* If you use FreeType to manipulate the contents of font files */
  2887. /* directly, be aware that the glyph index returned by this function */
  2888. /* doesn't always correspond to the internal indices used within the */
  2889. /* file. This is done to ensure that value~0 always corresponds to */
  2890. /* the `missing glyph'. If the first glyph is not named `.notdef', */
  2891. /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
  2892. /* the glyph ID~0 position, and whatever was there will be moved to */
  2893. /* the position `.notdef' had. For Type~1 fonts, if there is no */
  2894. /* `.notdef' glyph at all, then one will be created at index~0 and */
  2895. /* whatever was there will be moved to the last index -- Type~42 */
  2896. /* fonts are considered invalid under this condition. */
  2897. /* */
  2898. FT_EXPORT( FT_UInt )
  2899. FT_Get_Char_Index( FT_Face face,
  2900. FT_ULong charcode );
  2901. /*************************************************************************/
  2902. /* */
  2903. /* <Function> */
  2904. /* FT_Get_First_Char */
  2905. /* */
  2906. /* <Description> */
  2907. /* This function is used to return the first character code in the */
  2908. /* current charmap of a given face. It also returns the */
  2909. /* corresponding glyph index. */
  2910. /* */
  2911. /* <Input> */
  2912. /* face :: A handle to the source face object. */
  2913. /* */
  2914. /* <Output> */
  2915. /* agindex :: Glyph index of first character code. 0~if charmap is */
  2916. /* empty. */
  2917. /* */
  2918. /* <Return> */
  2919. /* The charmap's first character code. */
  2920. /* */
  2921. /* <Note> */
  2922. /* You should use this function with @FT_Get_Next_Char to be able to */
  2923. /* parse all character codes available in a given charmap. The code */
  2924. /* should look like this: */
  2925. /* */
  2926. /* { */
  2927. /* FT_ULong charcode; */
  2928. /* FT_UInt gindex; */
  2929. /* */
  2930. /* */
  2931. /* charcode = FT_Get_First_Char( face, &gindex ); */
  2932. /* while ( gindex != 0 ) */
  2933. /* { */
  2934. /* ... do something with (charcode,gindex) pair ... */
  2935. /* */
  2936. /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
  2937. /* } */
  2938. /* } */
  2939. /* */
  2940. /* Note that `*agindex' is set to~0 if the charmap is empty. The */
  2941. /* result itself can be~0 in two cases: if the charmap is empty or */
  2942. /* if the value~0 is the first valid character code. */
  2943. /* */
  2944. FT_EXPORT( FT_ULong )
  2945. FT_Get_First_Char( FT_Face face,
  2946. FT_UInt *agindex );
  2947. /*************************************************************************/
  2948. /* */
  2949. /* <Function> */
  2950. /* FT_Get_Next_Char */
  2951. /* */
  2952. /* <Description> */
  2953. /* This function is used to return the next character code in the */
  2954. /* current charmap of a given face following the value `char_code', */
  2955. /* as well as the corresponding glyph index. */
  2956. /* */
  2957. /* <Input> */
  2958. /* face :: A handle to the source face object. */
  2959. /* char_code :: The starting character code. */
  2960. /* */
  2961. /* <Output> */
  2962. /* agindex :: Glyph index of next character code. 0~if charmap */
  2963. /* is empty. */
  2964. /* */
  2965. /* <Return> */
  2966. /* The charmap's next character code. */
  2967. /* */
  2968. /* <Note> */
  2969. /* You should use this function with @FT_Get_First_Char to walk */
  2970. /* over all character codes available in a given charmap. See the */
  2971. /* note for this function for a simple code example. */
  2972. /* */
  2973. /* Note that `*agindex' is set to~0 when there are no more codes in */
  2974. /* the charmap. */
  2975. /* */
  2976. FT_EXPORT( FT_ULong )
  2977. FT_Get_Next_Char( FT_Face face,
  2978. FT_ULong char_code,
  2979. FT_UInt *agindex );
  2980. /*************************************************************************/
  2981. /* */
  2982. /* <Function> */
  2983. /* FT_Get_Name_Index */
  2984. /* */
  2985. /* <Description> */
  2986. /* Return the glyph index of a given glyph name. This function uses */
  2987. /* driver specific objects to do the translation. */
  2988. /* */
  2989. /* <Input> */
  2990. /* face :: A handle to the source face object. */
  2991. /* */
  2992. /* glyph_name :: The glyph name. */
  2993. /* */
  2994. /* <Return> */
  2995. /* The glyph index. 0~means `undefined character code'. */
  2996. /* */
  2997. FT_EXPORT( FT_UInt )
  2998. FT_Get_Name_Index( FT_Face face,
  2999. FT_String* glyph_name );
  3000. /*************************************************************************
  3001. *
  3002. * @macro:
  3003. * FT_SUBGLYPH_FLAG_XXX
  3004. *
  3005. * @description:
  3006. * A list of constants used to describe subglyphs. Please refer to the
  3007. * TrueType specification for the meaning of the various flags.
  3008. *
  3009. * @values:
  3010. * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
  3011. * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
  3012. * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
  3013. * FT_SUBGLYPH_FLAG_SCALE ::
  3014. * FT_SUBGLYPH_FLAG_XY_SCALE ::
  3015. * FT_SUBGLYPH_FLAG_2X2 ::
  3016. * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
  3017. *
  3018. */
  3019. #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
  3020. #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
  3021. #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
  3022. #define FT_SUBGLYPH_FLAG_SCALE 8
  3023. #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
  3024. #define FT_SUBGLYPH_FLAG_2X2 0x80
  3025. #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
  3026. /*************************************************************************
  3027. *
  3028. * @func:
  3029. * FT_Get_SubGlyph_Info
  3030. *
  3031. * @description:
  3032. * Retrieve a description of a given subglyph. Only use it if
  3033. * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
  3034. * returned otherwise.
  3035. *
  3036. * @input:
  3037. * glyph ::
  3038. * The source glyph slot.
  3039. *
  3040. * sub_index ::
  3041. * The index of the subglyph. Must be less than
  3042. * `glyph->num_subglyphs'.
  3043. *
  3044. * @output:
  3045. * p_index ::
  3046. * The glyph index of the subglyph.
  3047. *
  3048. * p_flags ::
  3049. * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
  3050. *
  3051. * p_arg1 ::
  3052. * The subglyph's first argument (if any).
  3053. *
  3054. * p_arg2 ::
  3055. * The subglyph's second argument (if any).
  3056. *
  3057. * p_transform ::
  3058. * The subglyph transformation (if any).
  3059. *
  3060. * @return:
  3061. * FreeType error code. 0~means success.
  3062. *
  3063. * @note:
  3064. * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
  3065. * interpreted depending on the flags returned in `*p_flags'. See the
  3066. * TrueType specification for details.
  3067. *
  3068. */
  3069. FT_EXPORT( FT_Error )
  3070. FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
  3071. FT_UInt sub_index,
  3072. FT_Int *p_index,
  3073. FT_UInt *p_flags,
  3074. FT_Int *p_arg1,
  3075. FT_Int *p_arg2,
  3076. FT_Matrix *p_transform );
  3077. /*************************************************************************/
  3078. /* */
  3079. /* <Enum> */
  3080. /* FT_FSTYPE_XXX */
  3081. /* */
  3082. /* <Description> */
  3083. /* A list of bit flags used in the `fsType' field of the OS/2 table */
  3084. /* in a TrueType or OpenType font and the `FSType' entry in a */
  3085. /* PostScript font. These bit flags are returned by */
  3086. /* @FT_Get_FSType_Flags; they inform client applications of embedding */
  3087. /* and subsetting restrictions associated with a font. */
  3088. /* */
  3089. /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
  3090. /* more details. */
  3091. /* */
  3092. /* <Values> */
  3093. /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
  3094. /* Fonts with no fsType bit set may be embedded and permanently */
  3095. /* installed on the remote system by an application. */
  3096. /* */
  3097. /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
  3098. /* Fonts that have only this bit set must not be modified, embedded */
  3099. /* or exchanged in any manner without first obtaining permission of */
  3100. /* the font software copyright owner. */
  3101. /* */
  3102. /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
  3103. /* If this bit is set, the font may be embedded and temporarily */
  3104. /* loaded on the remote system. Documents containing Preview & */
  3105. /* Print fonts must be opened `read-only'; no edits can be applied */
  3106. /* to the document. */
  3107. /* */
  3108. /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
  3109. /* If this bit is set, the font may be embedded but must only be */
  3110. /* installed temporarily on other systems. In contrast to Preview */
  3111. /* & Print fonts, documents containing editable fonts may be opened */
  3112. /* for reading, editing is permitted, and changes may be saved. */
  3113. /* */
  3114. /* FT_FSTYPE_NO_SUBSETTING :: */
  3115. /* If this bit is set, the font may not be subsetted prior to */
  3116. /* embedding. */
  3117. /* */
  3118. /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
  3119. /* If this bit is set, only bitmaps contained in the font may be */
  3120. /* embedded; no outline data may be embedded. If there are no */
  3121. /* bitmaps available in the font, then the font is unembeddable. */
  3122. /* */
  3123. /* <Note> */
  3124. /* While the fsType flags can indicate that a font may be embedded, a */
  3125. /* license with the font vendor may be separately required to use the */
  3126. /* font in this way. */
  3127. /* */
  3128. #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
  3129. #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
  3130. #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
  3131. #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
  3132. #define FT_FSTYPE_NO_SUBSETTING 0x0100
  3133. #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
  3134. /*************************************************************************/
  3135. /* */
  3136. /* <Function> */
  3137. /* FT_Get_FSType_Flags */
  3138. /* */
  3139. /* <Description> */
  3140. /* Return the fsType flags for a font. */
  3141. /* */
  3142. /* <Input> */
  3143. /* face :: A handle to the source face object. */
  3144. /* */
  3145. /* <Return> */
  3146. /* The fsType flags, @FT_FSTYPE_XXX. */
  3147. /* */
  3148. /* <Note> */
  3149. /* Use this function rather than directly reading the `fs_type' field */
  3150. /* in the @PS_FontInfoRec structure which is only guaranteed to */
  3151. /* return the correct results for Type~1 fonts. */
  3152. /* */
  3153. /* <Since> */
  3154. /* 2.3.8 */
  3155. /* */
  3156. FT_EXPORT( FT_UShort )
  3157. FT_Get_FSType_Flags( FT_Face face );
  3158. /*************************************************************************/
  3159. /* */
  3160. /* <Section> */
  3161. /* glyph_variants */
  3162. /* */
  3163. /* <Title> */
  3164. /* Glyph Variants */
  3165. /* */
  3166. /* <Abstract> */
  3167. /* The FreeType~2 interface to Unicode Ideographic Variation */
  3168. /* Sequences (IVS), using the SFNT cmap format~14. */
  3169. /* */
  3170. /* <Description> */
  3171. /* Many CJK characters have variant forms. They are a sort of grey */
  3172. /* area somewhere between being totally irrelevant and semantically */
  3173. /* distinct; for this reason, the Unicode consortium decided to */
  3174. /* introduce Ideographic Variation Sequences (IVS), consisting of a */
  3175. /* Unicode base character and one of 240 variant selectors */
  3176. /* (U+E0100-U+E01EF), instead of further extending the already huge */
  3177. /* code range for CJK characters. */
  3178. /* */
  3179. /* An IVS is registered and unique; for further details please refer */
  3180. /* to Unicode Technical Standard #37, the Ideographic Variation */
  3181. /* Database: */
  3182. /* */
  3183. /* http://www.unicode.org/reports/tr37/ */
  3184. /* */
  3185. /* To date (November 2012), the character with the most variants is */
  3186. /* U+9089, having 31 such IVS. */
  3187. /* */
  3188. /* Adobe and MS decided to support IVS with a new cmap subtable */
  3189. /* (format~14). It is an odd subtable because it is not a mapping of */
  3190. /* input code points to glyphs, but contains lists of all variants */
  3191. /* supported by the font. */
  3192. /* */
  3193. /* A variant may be either `default' or `non-default'. A default */
  3194. /* variant is the one you will get for that code point if you look it */
  3195. /* up in the standard Unicode cmap. A non-default variant is a */
  3196. /* different glyph. */
  3197. /* */
  3198. /*************************************************************************/
  3199. /*************************************************************************/
  3200. /* */
  3201. /* <Function> */
  3202. /* FT_Face_GetCharVariantIndex */
  3203. /* */
  3204. /* <Description> */
  3205. /* Return the glyph index of a given character code as modified by */
  3206. /* the variation selector. */
  3207. /* */
  3208. /* <Input> */
  3209. /* face :: */
  3210. /* A handle to the source face object. */
  3211. /* */
  3212. /* charcode :: */
  3213. /* The character code point in Unicode. */
  3214. /* */
  3215. /* variantSelector :: */
  3216. /* The Unicode code point of the variation selector. */
  3217. /* */
  3218. /* <Return> */
  3219. /* The glyph index. 0~means either `undefined character code', or */
  3220. /* `undefined selector code', or `no variation selector cmap */
  3221. /* subtable', or `current CharMap is not Unicode'. */
  3222. /* */
  3223. /* <Note> */
  3224. /* If you use FreeType to manipulate the contents of font files */
  3225. /* directly, be aware that the glyph index returned by this function */
  3226. /* doesn't always correspond to the internal indices used within */
  3227. /* the file. This is done to ensure that value~0 always corresponds */
  3228. /* to the `missing glyph'. */
  3229. /* */
  3230. /* This function is only meaningful if */
  3231. /* a) the font has a variation selector cmap sub table, */
  3232. /* and */
  3233. /* b) the current charmap has a Unicode encoding. */
  3234. /* */
  3235. /* <Since> */
  3236. /* 2.3.6 */
  3237. /* */
  3238. FT_EXPORT( FT_UInt )
  3239. FT_Face_GetCharVariantIndex( FT_Face face,
  3240. FT_ULong charcode,
  3241. FT_ULong variantSelector );
  3242. /*************************************************************************/
  3243. /* */
  3244. /* <Function> */
  3245. /* FT_Face_GetCharVariantIsDefault */
  3246. /* */
  3247. /* <Description> */
  3248. /* Check whether this variant of this Unicode character is the one to */
  3249. /* be found in the `cmap'. */
  3250. /* */
  3251. /* <Input> */
  3252. /* face :: */
  3253. /* A handle to the source face object. */
  3254. /* */
  3255. /* charcode :: */
  3256. /* The character codepoint in Unicode. */
  3257. /* */
  3258. /* variantSelector :: */
  3259. /* The Unicode codepoint of the variation selector. */
  3260. /* */
  3261. /* <Return> */
  3262. /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
  3263. /* variation selector cmap, or -1 if it is not a variant. */
  3264. /* */
  3265. /* <Note> */
  3266. /* This function is only meaningful if the font has a variation */
  3267. /* selector cmap subtable. */
  3268. /* */
  3269. /* <Since> */
  3270. /* 2.3.6 */
  3271. /* */
  3272. FT_EXPORT( FT_Int )
  3273. FT_Face_GetCharVariantIsDefault( FT_Face face,
  3274. FT_ULong charcode,
  3275. FT_ULong variantSelector );
  3276. /*************************************************************************/
  3277. /* */
  3278. /* <Function> */
  3279. /* FT_Face_GetVariantSelectors */
  3280. /* */
  3281. /* <Description> */
  3282. /* Return a zero-terminated list of Unicode variant selectors found */
  3283. /* in the font. */
  3284. /* */
  3285. /* <Input> */
  3286. /* face :: */
  3287. /* A handle to the source face object. */
  3288. /* */
  3289. /* <Return> */
  3290. /* A pointer to an array of selector code points, or NULL if there is */
  3291. /* no valid variant selector cmap subtable. */
  3292. /* */
  3293. /* <Note> */
  3294. /* The last item in the array is~0; the array is owned by the */
  3295. /* @FT_Face object but can be overwritten or released on the next */
  3296. /* call to a FreeType function. */
  3297. /* */
  3298. /* <Since> */
  3299. /* 2.3.6 */
  3300. /* */
  3301. FT_EXPORT( FT_UInt32* )
  3302. FT_Face_GetVariantSelectors( FT_Face face );
  3303. /*************************************************************************/
  3304. /* */
  3305. /* <Function> */
  3306. /* FT_Face_GetVariantsOfChar */
  3307. /* */
  3308. /* <Description> */
  3309. /* Return a zero-terminated list of Unicode variant selectors found */
  3310. /* for the specified character code. */
  3311. /* */
  3312. /* <Input> */
  3313. /* face :: */
  3314. /* A handle to the source face object. */
  3315. /* */
  3316. /* charcode :: */
  3317. /* The character codepoint in Unicode. */
  3318. /* */
  3319. /* <Return> */
  3320. /* A pointer to an array of variant selector code points which are */
  3321. /* active for the given character, or NULL if the corresponding list */
  3322. /* is empty. */
  3323. /* */
  3324. /* <Note> */
  3325. /* The last item in the array is~0; the array is owned by the */
  3326. /* @FT_Face object but can be overwritten or released on the next */
  3327. /* call to a FreeType function. */
  3328. /* */
  3329. /* <Since> */
  3330. /* 2.3.6 */
  3331. /* */
  3332. FT_EXPORT( FT_UInt32* )
  3333. FT_Face_GetVariantsOfChar( FT_Face face,
  3334. FT_ULong charcode );
  3335. /*************************************************************************/
  3336. /* */
  3337. /* <Function> */
  3338. /* FT_Face_GetCharsOfVariant */
  3339. /* */
  3340. /* <Description> */
  3341. /* Return a zero-terminated list of Unicode character codes found for */
  3342. /* the specified variant selector. */
  3343. /* */
  3344. /* <Input> */
  3345. /* face :: */
  3346. /* A handle to the source face object. */
  3347. /* */
  3348. /* variantSelector :: */
  3349. /* The variant selector code point in Unicode. */
  3350. /* */
  3351. /* <Return> */
  3352. /* A list of all the code points which are specified by this selector */
  3353. /* (both default and non-default codes are returned) or NULL if there */
  3354. /* is no valid cmap or the variant selector is invalid. */
  3355. /* */
  3356. /* <Note> */
  3357. /* The last item in the array is~0; the array is owned by the */
  3358. /* @FT_Face object but can be overwritten or released on the next */
  3359. /* call to a FreeType function. */
  3360. /* */
  3361. /* <Since> */
  3362. /* 2.3.6 */
  3363. /* */
  3364. FT_EXPORT( FT_UInt32* )
  3365. FT_Face_GetCharsOfVariant( FT_Face face,
  3366. FT_ULong variantSelector );
  3367. /*************************************************************************/
  3368. /* */
  3369. /* <Section> */
  3370. /* computations */
  3371. /* */
  3372. /* <Title> */
  3373. /* Computations */
  3374. /* */
  3375. /* <Abstract> */
  3376. /* Crunching fixed numbers and vectors. */
  3377. /* */
  3378. /* <Description> */
  3379. /* This section contains various functions used to perform */
  3380. /* computations on 16.16 fixed-float numbers or 2d vectors. */
  3381. /* */
  3382. /* <Order> */
  3383. /* FT_MulDiv */
  3384. /* FT_MulFix */
  3385. /* FT_DivFix */
  3386. /* FT_RoundFix */
  3387. /* FT_CeilFix */
  3388. /* FT_FloorFix */
  3389. /* FT_Vector_Transform */
  3390. /* FT_Matrix_Multiply */
  3391. /* FT_Matrix_Invert */
  3392. /* */
  3393. /*************************************************************************/
  3394. /*************************************************************************/
  3395. /* */
  3396. /* <Function> */
  3397. /* FT_MulDiv */
  3398. /* */
  3399. /* <Description> */
  3400. /* A very simple function used to perform the computation `(a*b)/c' */
  3401. /* with maximum accuracy (it uses a 64-bit intermediate integer */
  3402. /* whenever necessary). */
  3403. /* */
  3404. /* This function isn't necessarily as fast as some processor specific */
  3405. /* operations, but is at least completely portable. */
  3406. /* */
  3407. /* <Input> */
  3408. /* a :: The first multiplier. */
  3409. /* b :: The second multiplier. */
  3410. /* c :: The divisor. */
  3411. /* */
  3412. /* <Return> */
  3413. /* The result of `(a*b)/c'. This function never traps when trying to */
  3414. /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
  3415. /* on the signs of `a' and `b'. */
  3416. /* */
  3417. FT_EXPORT( FT_Long )
  3418. FT_MulDiv( FT_Long a,
  3419. FT_Long b,
  3420. FT_Long c );
  3421. /* */
  3422. /* The following #if 0 ... #endif is for the documentation formatter, */
  3423. /* hiding the internal `FT_MULFIX_INLINED' macro. */
  3424. #if 0
  3425. /*************************************************************************/
  3426. /* */
  3427. /* <Function> */
  3428. /* FT_MulFix */
  3429. /* */
  3430. /* <Description> */
  3431. /* A very simple function used to perform the computation */
  3432. /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
  3433. /* used to multiply a given value by a 16.16 fixed-point factor. */
  3434. /* */
  3435. /* <Input> */
  3436. /* a :: The first multiplier. */
  3437. /* b :: The second multiplier. Use a 16.16 factor here whenever */
  3438. /* possible (see note below). */
  3439. /* */
  3440. /* <Return> */
  3441. /* The result of `(a*b)/0x10000'. */
  3442. /* */
  3443. /* <Note> */
  3444. /* This function has been optimized for the case where the absolute */
  3445. /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
  3446. /* As this happens mainly when scaling from notional units to */
  3447. /* fractional pixels in FreeType, it resulted in noticeable speed */
  3448. /* improvements between versions 2.x and 1.x. */
  3449. /* */
  3450. /* As a conclusion, always try to place a 16.16 factor as the */
  3451. /* _second_ argument of this function; this can make a great */
  3452. /* difference. */
  3453. /* */
  3454. FT_EXPORT( FT_Long )
  3455. FT_MulFix( FT_Long a,
  3456. FT_Long b );
  3457. /* */
  3458. #endif
  3459. #ifdef FT_MULFIX_INLINED
  3460. #define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
  3461. #else
  3462. FT_EXPORT( FT_Long )
  3463. FT_MulFix( FT_Long a,
  3464. FT_Long b );
  3465. #endif
  3466. /*************************************************************************/
  3467. /* */
  3468. /* <Function> */
  3469. /* FT_DivFix */
  3470. /* */
  3471. /* <Description> */
  3472. /* A very simple function used to perform the computation */
  3473. /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
  3474. /* used to divide a given value by a 16.16 fixed-point factor. */
  3475. /* */
  3476. /* <Input> */
  3477. /* a :: The first multiplier. */
  3478. /* b :: The second multiplier. Use a 16.16 factor here whenever */
  3479. /* possible (see note below). */
  3480. /* */
  3481. /* <Return> */
  3482. /* The result of `(a*0x10000)/b'. */
  3483. /* */
  3484. /* <Note> */
  3485. /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
  3486. /* 32~bits, then the division is computed directly. Otherwise, we */
  3487. /* use a specialized version of @FT_MulDiv. */
  3488. /* */
  3489. FT_EXPORT( FT_Long )
  3490. FT_DivFix( FT_Long a,
  3491. FT_Long b );
  3492. /*************************************************************************/
  3493. /* */
  3494. /* <Function> */
  3495. /* FT_RoundFix */
  3496. /* */
  3497. /* <Description> */
  3498. /* A very simple function used to round a 16.16 fixed number. */
  3499. /* */
  3500. /* <Input> */
  3501. /* a :: The number to be rounded. */
  3502. /* */
  3503. /* <Return> */
  3504. /* The result of `(a + 0x8000) & -0x10000'. */
  3505. /* */
  3506. FT_EXPORT( FT_Fixed )
  3507. FT_RoundFix( FT_Fixed a );
  3508. /*************************************************************************/
  3509. /* */
  3510. /* <Function> */
  3511. /* FT_CeilFix */
  3512. /* */
  3513. /* <Description> */
  3514. /* A very simple function used to compute the ceiling function of a */
  3515. /* 16.16 fixed number. */
  3516. /* */
  3517. /* <Input> */
  3518. /* a :: The number for which the ceiling function is to be computed. */
  3519. /* */
  3520. /* <Return> */
  3521. /* The result of `(a + 0x10000 - 1) & -0x10000'. */
  3522. /* */
  3523. FT_EXPORT( FT_Fixed )
  3524. FT_CeilFix( FT_Fixed a );
  3525. /*************************************************************************/
  3526. /* */
  3527. /* <Function> */
  3528. /* FT_FloorFix */
  3529. /* */
  3530. /* <Description> */
  3531. /* A very simple function used to compute the floor function of a */
  3532. /* 16.16 fixed number. */
  3533. /* */
  3534. /* <Input> */
  3535. /* a :: The number for which the floor function is to be computed. */
  3536. /* */
  3537. /* <Return> */
  3538. /* The result of `a & -0x10000'. */
  3539. /* */
  3540. FT_EXPORT( FT_Fixed )
  3541. FT_FloorFix( FT_Fixed a );
  3542. /*************************************************************************/
  3543. /* */
  3544. /* <Function> */
  3545. /* FT_Vector_Transform */
  3546. /* */
  3547. /* <Description> */
  3548. /* Transform a single vector through a 2x2 matrix. */
  3549. /* */
  3550. /* <InOut> */
  3551. /* vector :: The target vector to transform. */
  3552. /* */
  3553. /* <Input> */
  3554. /* matrix :: A pointer to the source 2x2 matrix. */
  3555. /* */
  3556. /* <Note> */
  3557. /* The result is undefined if either `vector' or `matrix' is invalid. */
  3558. /* */
  3559. FT_EXPORT( void )
  3560. FT_Vector_Transform( FT_Vector* vec,
  3561. const FT_Matrix* matrix );
  3562. /*************************************************************************/
  3563. /* */
  3564. /* <Section> */
  3565. /* version */
  3566. /* */
  3567. /* <Title> */
  3568. /* FreeType Version */
  3569. /* */
  3570. /* <Abstract> */
  3571. /* Functions and macros related to FreeType versions. */
  3572. /* */
  3573. /* <Description> */
  3574. /* Note that those functions and macros are of limited use because */
  3575. /* even a new release of FreeType with only documentation changes */
  3576. /* increases the version number. */
  3577. /* */
  3578. /*************************************************************************/
  3579. /*************************************************************************
  3580. *
  3581. * @enum:
  3582. * FREETYPE_XXX
  3583. *
  3584. * @description:
  3585. * These three macros identify the FreeType source code version.
  3586. * Use @FT_Library_Version to access them at runtime.
  3587. *
  3588. * @values:
  3589. * FREETYPE_MAJOR :: The major version number.
  3590. * FREETYPE_MINOR :: The minor version number.
  3591. * FREETYPE_PATCH :: The patch level.
  3592. *
  3593. * @note:
  3594. * The version number of FreeType if built as a dynamic link library
  3595. * with the `libtool' package is _not_ controlled by these three
  3596. * macros.
  3597. *
  3598. */
  3599. #define FREETYPE_MAJOR 2
  3600. #define FREETYPE_MINOR 4
  3601. #define FREETYPE_PATCH 12
  3602. /*************************************************************************/
  3603. /* */
  3604. /* <Function> */
  3605. /* FT_Library_Version */
  3606. /* */
  3607. /* <Description> */
  3608. /* Return the version of the FreeType library being used. This is */
  3609. /* useful when dynamically linking to the library, since one cannot */
  3610. /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
  3611. /* @FREETYPE_PATCH. */
  3612. /* */
  3613. /* <Input> */
  3614. /* library :: A source library handle. */
  3615. /* */
  3616. /* <Output> */
  3617. /* amajor :: The major version number. */
  3618. /* */
  3619. /* aminor :: The minor version number. */
  3620. /* */
  3621. /* apatch :: The patch version number. */
  3622. /* */
  3623. /* <Note> */
  3624. /* The reason why this function takes a `library' argument is because */
  3625. /* certain programs implement library initialization in a custom way */
  3626. /* that doesn't use @FT_Init_FreeType. */
  3627. /* */
  3628. /* In such cases, the library version might not be available before */
  3629. /* the library object has been created. */
  3630. /* */
  3631. FT_EXPORT( void )
  3632. FT_Library_Version( FT_Library library,
  3633. FT_Int *amajor,
  3634. FT_Int *aminor,
  3635. FT_Int *apatch );
  3636. /*************************************************************************/
  3637. /* */
  3638. /* <Function> */
  3639. /* FT_Face_CheckTrueTypePatents */
  3640. /* */
  3641. /* <Description> */
  3642. /* Parse all bytecode instructions of a TrueType font file to check */
  3643. /* whether any of the patented opcodes are used. This is only useful */
  3644. /* if you want to be able to use the unpatented hinter with */
  3645. /* fonts that do *not* use these opcodes. */
  3646. /* */
  3647. /* Note that this function parses *all* glyph instructions in the */
  3648. /* font file, which may be slow. */
  3649. /* */
  3650. /* <Input> */
  3651. /* face :: A face handle. */
  3652. /* */
  3653. /* <Return> */
  3654. /* 1~if this is a TrueType font that uses one of the patented */
  3655. /* opcodes, 0~otherwise. */
  3656. /* */
  3657. /* <Note> */
  3658. /* Since May 2010, TrueType hinting is no longer patented. */
  3659. /* */
  3660. /* <Since> */
  3661. /* 2.3.5 */
  3662. /* */
  3663. FT_EXPORT( FT_Bool )
  3664. FT_Face_CheckTrueTypePatents( FT_Face face );
  3665. /*************************************************************************/
  3666. /* */
  3667. /* <Function> */
  3668. /* FT_Face_SetUnpatentedHinting */
  3669. /* */
  3670. /* <Description> */
  3671. /* Enable or disable the unpatented hinter for a given face. */
  3672. /* Only enable it if you have determined that the face doesn't */
  3673. /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
  3674. /* */
  3675. /* <Input> */
  3676. /* face :: A face handle. */
  3677. /* */
  3678. /* value :: New boolean setting. */
  3679. /* */
  3680. /* <Return> */
  3681. /* The old setting value. This will always be false if this is not */
  3682. /* an SFNT font, or if the unpatented hinter is not compiled in this */
  3683. /* instance of the library. */
  3684. /* */
  3685. /* <Note> */
  3686. /* Since May 2010, TrueType hinting is no longer patented. */
  3687. /* */
  3688. /* <Since> */
  3689. /* 2.3.5 */
  3690. /* */
  3691. FT_EXPORT( FT_Bool )
  3692. FT_Face_SetUnpatentedHinting( FT_Face face,
  3693. FT_Bool value );
  3694. /* */
  3695. FT_END_HEADER
  3696. #endif /* __FREETYPE_H__ */
  3697. /* END */