From 415b878844cb741c836ffc03bdecab4d7bf2cf6d Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Sun, 16 Nov 2008 00:50:14 +0000 Subject: [PATCH] - Added support for Mac OSX system fonts in texte.c. - Inverted the "AntiAlias" and "No AA" labels so it's more intuitive that way. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@349 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Grafx2.xcodeproj/project.pbxproj | 16 ++++-- Grafx2.xcodeproj/xx.pbxuser | 18 +++---- Grafx2.xcodeproj/xx.perspective | 78 ++++++++++++++++------------- boutons.c | 4 +- clavier.c | 2 +- texte.c | 86 ++++++++++++++++++++++++++++---- 6 files changed, 142 insertions(+), 62 deletions(-) diff --git a/Grafx2.xcodeproj/project.pbxproj b/Grafx2.xcodeproj/project.pbxproj index 048530c4..c6737b66 100644 --- a/Grafx2.xcodeproj/project.pbxproj +++ b/Grafx2.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; }; F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; }; F5AD4B1F0EA8CCF0009CCAC4 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AD4B1E0EA8CCF0009CCAC4 /* version.c */; }; + F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */; }; F5B138940EB71977000B83CC /* texte.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B138930EB71977000B83CC /* texte.c */; }; F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B138C20EB71D28000B83CC /* SDL_ttf */; }; F5B19B8D0EA4BE3E003F4BA4 /* aide.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B750EA4BE3E003F4BA4 /* aide.c */; }; @@ -27,7 +28,6 @@ F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7B0EA4BE3E003F4BA4 /* graph.c */; }; F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7C0EA4BE3E003F4BA4 /* init.c */; }; F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7D0EA4BE3E003F4BA4 /* io.c */; }; - F5B19B960EA4BE3E003F4BA4 /* linux.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7E0EA4BE3E003F4BA4 /* linux.c */; }; F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */; }; F5B19B980EA4BE3E003F4BA4 /* moteur.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B800EA4BE3E003F4BA4 /* moteur.c */; }; F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B820EA4BE3E003F4BA4 /* op_c.c */; }; @@ -118,6 +118,7 @@ F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = ""; }; F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = ""; }; F5AD4B1E0EA8CCF0009CCAC4 /* version.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = version.c; sourceTree = ""; }; + F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; F5B138930EB71977000B83CC /* texte.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = texte.c; sourceTree = ""; }; F5B138C20EB71D28000B83CC /* SDL_ttf */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_ttf; path = /Library/Frameworks/SDL_ttf.framework/SDL_ttf; sourceTree = ""; }; F5B19B6C0EA4BDA8003F4BA4 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = ""; }; @@ -130,7 +131,6 @@ F5B19B7B0EA4BE3E003F4BA4 /* graph.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = graph.c; sourceTree = ""; }; F5B19B7C0EA4BE3E003F4BA4 /* init.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; F5B19B7D0EA4BE3E003F4BA4 /* io.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = ""; }; - F5B19B7E0EA4BE3E003F4BA4 /* linux.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = linux.c; sourceTree = ""; }; F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = loadsave.c; sourceTree = ""; }; F5B19B800EA4BE3E003F4BA4 /* moteur.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = moteur.c; sourceTree = ""; }; F5B19B820EA4BE3E003F4BA4 /* op_c.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = op_c.c; sourceTree = ""; }; @@ -164,6 +164,7 @@ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, F5B19C1D0EA4D71C003F4BA4 /* CoreFoundation.framework in Frameworks */, F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */, + F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -209,6 +210,7 @@ 29B97314FDCFA39411CA2CEA /* Grafx2 */ = { isa = PBXGroup; children = ( + F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */, F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */, F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */, F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */, @@ -233,7 +235,6 @@ F5B19B7B0EA4BE3E003F4BA4 /* graph.c */, F5B19B7C0EA4BE3E003F4BA4 /* init.c */, F5B19B7D0EA4BE3E003F4BA4 /* io.c */, - F5B19B7E0EA4BE3E003F4BA4 /* linux.c */, F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */, F5B19B800EA4BE3E003F4BA4 /* moteur.c */, F5B19B820EA4BE3E003F4BA4 /* op_c.c */, @@ -352,7 +353,6 @@ F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */, F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */, F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */, - F5B19B960EA4BE3E003F4BA4 /* linux.c in Sources */, F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */, F5B19B980EA4BE3E003F4BA4 /* moteur.c in Sources */, F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */, @@ -392,8 +392,10 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\""; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; @@ -405,10 +407,12 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\""; PRODUCT_NAME = Grafx2; WRAPPER_EXTENSION = app; ZERO_LINK = YES; @@ -425,8 +429,10 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; INFOPLIST_FILE = Info.plist; @@ -436,10 +442,12 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\""; PRODUCT_NAME = Grafx2; WRAPPER_EXTENSION = app; }; diff --git a/Grafx2.xcodeproj/xx.pbxuser b/Grafx2.xcodeproj/xx.pbxuser index a6599352..b414d2ee 100644 --- a/Grafx2.xcodeproj/xx.pbxuser +++ b/Grafx2.xcodeproj/xx.pbxuser @@ -43,7 +43,7 @@ PBXFileTableDataSourceColumnWidthsKey = ( 20, 453, - 58.2085, + 58, ); PBXFileTableDataSourceColumnsKey = ( PBXErrorsWarningsDataSource_TypeID, @@ -77,7 +77,7 @@ 43, 20, 79, - 95, + 121, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, @@ -145,7 +145,7 @@ }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnSortingKey = PBXTargetDataSource_PrimaryAttribute; PBXFileTableDataSourceColumnWidthsKey = ( 20, 200, @@ -165,8 +165,8 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 248180012; - PBXWorkspaceStateSaveDate = 248180012; + PBXPerProjectTemplateStateSaveDate = 248478999; + PBXWorkspaceStateSaveDate = 248478999; }; sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */; userBuildSettings = { @@ -186,10 +186,10 @@ }; F5B138930EB71977000B83CC /* texte.c */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1092, 4807}}"; - sepNavSelRange = "{1127, 0}"; - sepNavVisRect = "{{0, 339}, {867, 536}}"; - sepNavWindowFrame = "{{34, 37}, {906, 665}}"; + sepNavIntBoundsRect = "{{0, 0}, {932, 8455}}"; + sepNavSelRange = "{2431, 70}"; + sepNavVisRect = "{{0, 1377}, {867, 536}}"; + sepNavWindowFrame = "{{67, 41}, {906, 665}}"; }; }; F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */ = { diff --git a/Grafx2.xcodeproj/xx.perspective b/Grafx2.xcodeproj/xx.perspective index 1dc176d0..1a443b47 100644 --- a/Grafx2.xcodeproj/xx.perspective +++ b/Grafx2.xcodeproj/xx.perspective @@ -3,7 +3,7 @@ ActivePerspectiveName - Project + Build AllowedModules @@ -188,9 +188,9 @@ PerspectiveWidths - 977 - 977 - 977 + 1003 + 1003 + 1003 Perspectives @@ -259,17 +259,21 @@ PBXSmartGroupTreeModuleOutlineStateExpansionKey 29B97314FDCFA39411CA2CEA + F5AE83FC0ECF8FD300200704 + F5AE84000ECF8FD300200704 1C37FBAC04509CD000000102 + F5AE85220ECF9FBE00200704 + 1C08E77C0454961000C914BD PBXSmartGroupTreeModuleOutlineStateSelectionKey - 9 + 1 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {305, 604}} + {{0, 0}, {305, 560}} PBXTopSmartGroupGIDs @@ -279,14 +283,12 @@ GeometryConfiguration Frame - {{0, 0}, {322, 622}} + {{0, 0}, {322, 578}} GroupTreeTableConfiguration MainColumn 305 - RubberWindowFrame - 62 83 977 663 0 0 1024 746 Module PBXSmartGroupTreeModule @@ -323,9 +325,7 @@ GeometryConfiguration Frame - {{0, 0}, {650, 0}} - RubberWindowFrame - 62 83 977 663 0 0 1024 746 + {{0, 0}, {676, 0}} Module PBXNavigatorGroup @@ -334,12 +334,10 @@ Proportion - 617pt + 573pt Tabs - BecomeActive - ContentConfiguration PBXProjectModuleGUID @@ -350,9 +348,7 @@ GeometryConfiguration Frame - {{10, 27}, {650, 590}} - RubberWindowFrame - 62 83 977 663 0 0 1024 746 + {{10, 27}, {676, 546}} Module XCDetailModule @@ -393,7 +389,7 @@ Proportion - 650pt + 676pt Name @@ -411,11 +407,11 @@ TableOfContents - F5368CFF0EC8ADDF00444B30 + F5AE83EB0ECF87BC00200704 1CA23ED40692098700951B8B - F5368D000EC8ADDF00444B30 + F5AE83EC0ECF87BC00200704 F5A33EBD0EC89C3000F8052D - F5368D010EC8ADDF00444B30 + F5AE83ED0ECF87BC00200704 1CA23EDF0692099D00951B8B 1CA23EE00692099D00951B8B 1CA23EE10692099D00951B8B @@ -449,6 +445,8 @@ Layout + BecomeActive + ContentConfiguration PBXBottomSmartGroupGIDs @@ -463,7 +461,7 @@ PBXSmartGroupTreeModuleColumnWidthsKey - 193 + 123 PBXSmartGroupTreeModuleColumnsKey_v4 @@ -481,7 +479,7 @@ PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {0, 0}} + {{0, 0}, {123, 536}} PBXTopSmartGroupGIDs @@ -491,17 +489,19 @@ GeometryConfiguration Frame - {{0, 0}, {210, 622}} + {{0, 0}, {140, 554}} GroupTreeTableConfiguration MainColumn - 193 + 123 + RubberWindowFrame + 26 67 953 595 0 0 1024 746 Module PBXSmartGroupTreeModule Proportion - 210pt + 140pt Dock @@ -533,7 +533,9 @@ GeometryConfiguration Frame - {{0, 0}, {762, 0}} + {{0, 0}, {808, 0}} + RubberWindowFrame + 26 67 953 595 0 0 1024 746 Module PBXNavigatorGroup @@ -542,7 +544,7 @@ Proportion - 0pt + 549pt Tabs @@ -560,7 +562,9 @@ GeometryConfiguration Frame - {{10, 27}, {0, -27}} + {{10, 27}, {808, 522}} + RubberWindowFrame + 26 67 953 595 0 0 1024 746 Module PBXBuildResultsModule @@ -622,7 +626,7 @@ Proportion - 0pt + 808pt Name @@ -640,14 +644,14 @@ TableOfContents - F5368D020EC8ADDF00444B30 + F5AE83EE0ECF87BC00200704 1CA23EE50692099D00951B8B - F5368D030EC8ADDF00444B30 + F5AE83EF0ECF87BC00200704 F5A33EC20EC89C3000F8052D - F5368D040EC8ADDF00444B30 + F5AE83F00ECF87BC00200704 XCMainBuildResultsModuleGUID 1CA23EE80692099D00951B8B - F5368D050EC8ADDF00444B30 + F5AE83F10ECF87BC00200704 ToolbarConfiguration xcode.toolbar.config.buildAndRun @@ -794,6 +798,8 @@ PerspectivesBarVisible + PinnedNavigatorIdentifier + F5AE852A0ECFA27900200704 ShelfIsVisible SourceDescription @@ -819,7 +825,7 @@ /Users/xx/Grafx2/Grafx2.xcodeproj WindowString - 62 83 977 663 0 0 1024 746 + 26 67 953 595 0 0 1024 746 WindowTools diff --git a/boutons.c b/boutons.c index 4b0da459..45ff4c03 100644 --- a/boutons.c +++ b/boutons.c @@ -5845,7 +5845,7 @@ void Bouton_Texte() // AA Fenetre_Definir_bouton_normal(9,51,80,14,"",0,1,SDLK_LAST); // 3 - Print_dans_fenetre(13,54,AntiAlias?"AntiAlias":" No AA ", CM_Noir, CM_Clair); + Print_dans_fenetre(13,54,AntiAlias?" No AA ":"AntiAlias", CM_Noir, CM_Clair); // Scroller des fontes Fenetre_Definir_bouton_scroller(94,33,NB_FONTES*8,Fonte_nombre,NB_FONTES,Debut_liste); // 4 @@ -6062,7 +6062,7 @@ void Bouton_Texte() case 3: // AA AntiAlias = (AntiAlias==0); Effacer_curseur(); - Print_dans_fenetre(13,54,AntiAlias?"AntiAlias":" No AA ", CM_Noir, CM_Clair); + Print_dans_fenetre(13,54,AntiAlias?" No AA ":"AntiAlias", CM_Noir, CM_Clair); A_previsionner=1; break; diff --git a/clavier.c b/clavier.c index 0458d193..7795a930 100644 --- a/clavier.c +++ b/clavier.c @@ -552,7 +552,7 @@ word Conversion_ANSI(SDL_keysym Sym) { return(SDLK_BACKSPACE); } - // We make to difference between return & enter in the app context. + // We don't make any difference between return & enter in the app context. if(Sym.unicode == 3) { return(SDLK_RETURN); diff --git a/texte.c b/texte.c index 09b0daab..5604a0dc 100644 --- a/texte.c +++ b/texte.c @@ -1,6 +1,7 @@ /* Grafx2 - The Ultimate 256-color bitmap paint program Copyright 2008 Yves Rizoud + Copyright 2008 Franck Charlet Copyright 2008 Adrien Destugues Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) @@ -36,9 +37,15 @@ #endif #ifdef __linux__ +#ifdef __macosx__ + #include + #import + #import +#else #include #endif #endif +#endif #include // SFont #include "SFont.h" @@ -66,6 +73,7 @@ int Fonte_nombre; // Inspiré par Allegro #define EXTID(a,b,c) ((((a)&255)<<16) | (((b)&255)<<8) | (((c)&255))) +#define EXTID4(a,b,c,d) ((((a)&255)<<24) | (((b)&255)<<16) | (((c)&255)<<8) | (((d)&255))) int Compare_fontes(T_FONTE * Fonte1, T_FONTE * Fonte2) { @@ -85,13 +93,34 @@ void Ajout_fonte(const char *Nom) int Indice; // Détermination du type: + +#ifdef __macosx__ + + if (Taille < 6) return; + + char strFontName[512]; + CFStringRef CFSFontName;// = CFSTR(Nom); + + CFSFontName = CFStringCreateWithBytes(NULL, (UInt8 *) Nom, Taille - 1, kCFStringEncodingASCII, false); + // Fix some funny names + CFStringGetCString(CFSFontName, strFontName, 512, kCFStringEncodingASCII); + + // Now we have a printable font name, use it + Nom = strFontName; + +#else if (Taille<5 || - Nom[Taille-5]!='.') + Nom[Taille-5]!='.') return; +#endif + switch (EXTID(tolower(Nom[Taille-4]), tolower(Nom[Taille-3]), tolower(Nom[Taille-2]))) { case EXTID('t','t','f'): case EXTID('f','o','n'): +#ifdef __macosx__ + case EXTID('o','t','f'): +#endif Fonte->EstTrueType = 1; Fonte->EstImage = 0; break; @@ -110,7 +139,19 @@ void Ajout_fonte(const char *Nom) Fonte->EstImage = 1; break; default: - return; + #ifdef __macosx__ + if(strcasecmp(&Nom[Taille-6], "dfont") == 0) + { + Fonte->EstTrueType = 1; + Fonte->EstImage = 0; + } + else + { + return; + } + #else + return; + #endif } Fonte->Nom = (char *)malloc(Taille); @@ -260,18 +301,43 @@ void Initialisation_Texte(void) #elif defined(__linux__) // Récupération de la liste des fonts avec fontconfig #ifndef NOTTF - #define USE_XLIB - #ifdef USE_XLIB - int i,number; - Display* dpy = XOpenDisplay(NULL); - char** font_path_list = XGetFontPath(dpy,&number); + #ifdef __macosx__ - for(i=0;i