From a6069d1c021b7762d30d3b95d199b44d9f64fd42 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 14 Feb 2012 18:08:12 +0000 Subject: [PATCH] Introjucer: added Xcode frameworks setting. Fix for win32 bold fonts. Fix for 64-bit plugin builds. --- .../Project Saving/jucer_ProjectExport_XCode.h | 7 +++++++ .../Introjucer/Source/Utility/jucer_PresetIDs.h | 1 + .../utility/juce_IncludeSystemHeaders.h | 2 +- .../juce_audio_processors.h | 2 +- .../native/juce_win32_DirectWriteTypeLayout.cpp | 17 +++++++++++------ 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 792a8c80ca..ce98d7eb28 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -79,6 +79,7 @@ public: //============================================================================== Value getObjCSuffix() { return getSetting ("objCExtraSuffix"); } Value getPListToMerge() { return getSetting ("customPList"); } + Value getExtraFrameworks() { return getSetting (Ids::extraFrameworks); } int getLaunchPreferenceOrderForCurrentOS() { @@ -131,6 +132,10 @@ public: "You can paste the contents of an XML PList file in here, and the settings that it contains will override any " "settings that the Introjucer creates. BEWARE! When doing this, be careful to remove from the XML any " "values that you DO want the introjucer to change!"); + + props.add (new TextPropertyComponent (getExtraFrameworks(), "Extra Frameworks", 2048, false), + "A comma-separated list of extra frameworks that should be added to the build. " + "(Don't include the .framework extension in the name)"); } void launchProject() @@ -706,6 +711,8 @@ private: if (! projectType.isLibrary()) { StringArray s (xcodeFrameworks); + s.addTokens (getExtraFrameworks().toString(), ",;", "\"'"); + s.trim(); s.removeDuplicates (true); s.sort (true); diff --git a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h index 1df73c0a9c..7c3d63945e 100644 --- a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h @@ -61,6 +61,7 @@ namespace Ids DECLARE_ID (osxSDK); DECLARE_ID (osxCompatibility); DECLARE_ID (osxArchitecture); + DECLARE_ID (extraFrameworks); DECLARE_ID (winArchitecture); DECLARE_ID (winWarningLevel); DECLARE_ID (bigIcon); diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h index ad78cfef7e..8344e5c5d4 100644 --- a/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h @@ -47,7 +47,7 @@ #undef Time #else - #ifndef JUCE_SUPPORT_CARBON + #if ! (defined (JUCE_SUPPORT_CARBON) || JUCE_64BIT) #define JUCE_SUPPORT_CARBON 1 #endif diff --git a/modules/juce_audio_processors/juce_audio_processors.h b/modules/juce_audio_processors/juce_audio_processors.h index ef99f606ba..f21cda1616 100644 --- a/modules/juce_audio_processors/juce_audio_processors.h +++ b/modules/juce_audio_processors/juce_audio_processors.h @@ -54,7 +54,7 @@ // #error "You need to set either the JUCE_PLUGINHOST_AU anr/or JUCE_PLUGINHOST_VST flags if you're using this module!" #endif -#ifndef JUCE_SUPPORT_CARBON +#if ! (defined (JUCE_SUPPORT_CARBON) || JUCE_64BIT) #define JUCE_SUPPORT_CARBON 1 #endif diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp index d67fcb2948..b130baf935 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp @@ -153,8 +153,8 @@ namespace DirectWriteTypeLayout HRESULT hr = fontCollection->GetFontFromFontFace (glyphRun->fontFace, dwFont.resetAndGetPointerAddress()); jassert (dwFont != nullptr); - if (dwFont->GetWeight() == DWRITE_FONT_WEIGHT_BOLD) styleFlags &= Font::bold; - if (dwFont->GetStyle() == DWRITE_FONT_STYLE_ITALIC) styleFlags &= Font::italic; + if (dwFont->GetWeight() == DWRITE_FONT_WEIGHT_BOLD) styleFlags |= Font::bold; + if (dwFont->GetStyle() == DWRITE_FONT_STYLE_ITALIC) styleFlags |= Font::italic; ComSmartPtr dwFontFamily; hr = dwFont->GetFontFamily (dwFontFamily.resetAndGetPointerAddress()); @@ -248,12 +248,17 @@ namespace DirectWriteTypeLayout range.startPosition = attr.range.getStart(); range.length = jmin (attr.range.getLength(), textLen - attr.range.getStart()); - if (attr.getFont() != nullptr) + const Font* const font = attr.getFont(); + + if (font != nullptr) { - textLayout->SetFontFamilyName (attr.getFont()->getTypefaceName().toWideCharPointer(), range); + textLayout->SetFontFamilyName (font->getTypefaceName().toWideCharPointer(), range); + + const float fontHeightToEmSizeFactor = getFontHeightToEmSizeFactor (*font, *fontCollection); + textLayout->SetFontSize (font->getHeight() * fontHeightToEmSizeFactor, range); - const float fontHeightToEmSizeFactor = getFontHeightToEmSizeFactor (*attr.getFont(), *fontCollection); - textLayout->SetFontSize (attr.getFont()->getHeight() * fontHeightToEmSizeFactor, range); + if (font->isBold()) textLayout->SetFontWeight (DWRITE_FONT_WEIGHT_BOLD, range); + if (font->isItalic()) textLayout->SetFontStyle (DWRITE_FONT_STYLE_ITALIC, range); } if (attr.getColour() != nullptr)