[haiku-commits] haiku: hrev52737 - in src: preferences/appearance servers/app/font servers/app

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 9 Jan 2019 20:36:19 -0500 (EST)

hrev52737 adds 3 changesets to branch 'master'
old head: ec12d1fd3ebbdfa8e08a7c75c48d8be4e72f1436
new head: 177db1e47fe26cd74d606a79065a5fbdd1f50097
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=177db1e47fe2+%5Eec12d1fd3ebb

----------------------------------------------------------------------------

166dc2bfec68: Appearance: Remove "sub-pixel anti-aliasing is not enabled" 
message.
  
  FreeType 2.8+ uses a non-patent-encumbered algorithm for this by default,
  and as we have used it for quite a while now, this message is obsolete.

5464abed7ee7: Enable sub-pixel font anti-aliasing by default.
  
  Now that stippi has fixed the FreeType bitmap filter in app_server,
  this rendering mode looks much nicer than Grayscale does.
  
  Fixes #13290.

177db1e47fe2: app_server: Switch default UI font to Noto Sans Display.
  
  Fixes #14779.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

7 files changed, 9 insertions(+), 72 deletions(-)
.../appearance/AntialiasingSettingsView.cpp      | 59 +-------------------
.../appearance/AntialiasingSettingsView.h        |  2 -
src/preferences/appearance/Jamfile               |  4 --
src/servers/app/DesktopSettings.cpp              |  2 +-
src/servers/app/ServerConfig.h                   |  4 +-
src/servers/app/font/FontManager.cpp             |  8 +--
src/servers/app/font/GlyphLayoutEngine.h         |  2 +-

############################################################################

Commit:      166dc2bfec6811f51282ecaaec51869e1238fb77
URL:         https://git.haiku-os.org/haiku/commit/?id=166dc2bfec68
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Jan 10 00:51:24 2019 UTC

Appearance: Remove "sub-pixel anti-aliasing is not enabled" message.

FreeType 2.8+ uses a non-patent-encumbered algorithm for this by default,
and as we have used it for quite a while now, this message is obsolete.

----------------------------------------------------------------------------

diff --git a/src/preferences/appearance/AntialiasingSettingsView.cpp 
b/src/preferences/appearance/AntialiasingSettingsView.cpp
index ad3df7536b..4810ed75ed 100644
--- a/src/preferences/appearance/AntialiasingSettingsView.cpp
+++ b/src/preferences/appearance/AntialiasingSettingsView.cpp
@@ -10,10 +10,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <ft2build.h>
-#include FT_CONFIG_OPTIONS_H
-       // for detected the availablility of subpixel anti-aliasing
-
 #include <Box.h>
 #include <Catalog.h>
 #include <LayoutBuilder.h>
@@ -114,21 +110,6 @@ AntialiasingSettingsView::AntialiasingSettingsView(const 
char* name)
        fHintingMenuField->SetEnabled(false);
 #endif
 
-#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-       // subpixelAntialiasingDisabledLabel
-       // TODO: Replace with layout friendly constructor once available.
-       fSubpixelAntialiasingDisabledLabel
-               = new BTextView("unavailable label");
-       fSubpixelAntialiasingDisabledLabel->SetText(B_TRANSLATE(
-               "Subpixel based anti-aliasing in combination with glyph hinting 
is not "
-               "available in this build of Haiku to avoid possible patent 
issues. To "
-               "enable this feature, you have to build Haiku yourself and 
enable "
-               "certain options in the libfreetype configuration header."));
-       
fSubpixelAntialiasingDisabledLabel->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
-       fSubpixelAntialiasingDisabledLabel->MakeEditable(false);
-       fSubpixelAntialiasingDisabledLabel->MakeSelectable(false);
-#endif // !FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
        BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, 
B_USE_DEFAULT_SPACING)
        // controls pane
                .Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 0)
@@ -139,19 +120,12 @@ AntialiasingSettingsView::AntialiasingSettingsView(const 
char* name)
 
                .Add(fAverageWeightControl, 0, 2, 2)
 
-#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-               // hinting+subpixel unavailable info
-               .Add(fSubpixelAntialiasingDisabledLabel, 0, 3, 2)
-#else
-               .Add(BSpaceLayoutItem::CreateGlue(), 0, 3, 2)
-#endif
                .AddGlue(0, 4)
                .SetInsets(B_USE_WINDOW_SPACING);
 
        _SetCurrentAntialiasing();
        _SetCurrentHinting();
        _SetCurrentAverageWeight();
-       _UpdateColors();
 }
 
 
@@ -219,14 +193,6 @@ AntialiasingSettingsView::MessageReceived(BMessage *msg)
                        Window()->PostMessage(kMsgUpdate);
                        break;
                }
-               case B_COLORS_UPDATED:
-               {
-                       if 
(msg->HasColor(ui_color_name(B_PANEL_BACKGROUND_COLOR))
-                               || 
msg->HasColor(ui_color_name(B_PANEL_TEXT_COLOR))) {
-                               _UpdateColors();
-                       }
-                       break;
-               }
                default:
                        BView::MessageReceived(msg);
        }
@@ -322,23 +288,6 @@ AntialiasingSettingsView::_SetCurrentAverageWeight()
 }
 
 
-void
-AntialiasingSettingsView::_UpdateColors()
-{
-#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-       rgb_color infoColor = disable_color(ui_color(B_PANEL_BACKGROUND_COLOR),
-               ui_color(B_PANEL_TEXT_COLOR));
-
-       BFont font;
-       uint32 mode = 0;
-       fSubpixelAntialiasingDisabledLabel->GetFontAndColor(&font, &mode);
-       font.SetFace(B_ITALIC_FACE);
-       fSubpixelAntialiasingDisabledLabel->SetFontAndColor(&font, mode,
-               &infoColor);
-#endif
-}
-
-
 void
 AntialiasingSettingsView::SetDefaults()
 {
diff --git a/src/preferences/appearance/AntialiasingSettingsView.h 
b/src/preferences/appearance/AntialiasingSettingsView.h
index ed7cb32a02..520579fed8 100644
--- a/src/preferences/appearance/AntialiasingSettingsView.h
+++ b/src/preferences/appearance/AntialiasingSettingsView.h
@@ -34,7 +34,6 @@ private:
                        void                    _BuildHintingMenu();
                        void                    _SetCurrentHinting();
                        void                    _SetCurrentAverageWeight();
-                       void                    _UpdateColors();
 
 protected:
                        float                   fDivider;
@@ -44,7 +43,6 @@ protected:
                        BMenuField*             fHintingMenuField;
                        BPopUpMenu*             fHintingMenu;
                        BSlider*                fAverageWeightControl;
-                       BTextView*              
fSubpixelAntialiasingDisabledLabel;
 
                        bool                    fSavedSubpixelAntialiasing;
                        bool                    fCurrentSubpixelAntialiasing;
diff --git a/src/preferences/appearance/Jamfile 
b/src/preferences/appearance/Jamfile
index 5bbe71f1b4..2ebfbe4993 100644
--- a/src/preferences/appearance/Jamfile
+++ b/src/preferences/appearance/Jamfile
@@ -3,10 +3,6 @@ SubDir HAIKU_TOP src preferences appearance ;
 AddSubDirSupportedPlatforms libbe_test ;
 
 UsePrivateHeaders app interface [ FDirName servers app ] ;
-UseBuildFeatureHeaders freetype ;
-
-Includes [ FGristFiles AntialiasingSettingsView.cpp ]
-       : [ BuildFeatureAttribute freetype : headers ] ;
 
 Preference Appearance :
        APRMain.cpp

############################################################################

Commit:      5464abed7ee7be129f740cd37e07f88494ff4954
URL:         https://git.haiku-os.org/haiku/commit/?id=5464abed7ee7
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Jan 10 01:29:47 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/13290

Enable sub-pixel font anti-aliasing by default.

Now that stippi has fixed the FreeType bitmap filter in app_server,
this rendering mode looks much nicer than Grayscale does.

Fixes #13290.

----------------------------------------------------------------------------

diff --git a/src/preferences/appearance/AntialiasingSettingsView.cpp 
b/src/preferences/appearance/AntialiasingSettingsView.cpp
index 4810ed75ed..8b1a73147f 100644
--- a/src/preferences/appearance/AntialiasingSettingsView.cpp
+++ b/src/preferences/appearance/AntialiasingSettingsView.cpp
@@ -29,10 +29,6 @@
 #define B_TRANSLATION_CONTEXT "AntialiasingSettingsView"
 
 
-//#define DISABLE_HINTING_CONTROL
-       // if defined, the hinting menu is disabled (hinting not properly
-       // implemented)
-
 static const int32 kMsgSetAntialiasing = 'anti';
 static const int32 kMsgSetHinting = 'hint';
 static const int32 kMsgSetAverageWeight = 'avrg';
@@ -55,7 +51,7 @@ enum {
 
 static const uint8 kDefaultHintingMode = HINTING_MODE_ON;
 static const unsigned char kDefaultAverageWeight = 120;
-static const bool kDefaultSubpixelAntialiasing = false;
+static const bool kDefaultSubpixelAntialiasing = true;
 
 extern void set_subpixel_antialiasing(bool subpix);
 extern status_t get_subpixel_antialiasing(bool* subpix);
@@ -106,9 +102,7 @@ AntialiasingSettingsView::AntialiasingSettingsView(const 
char* name)
        fHintingMenuField = new BMenuField("hinting", B_TRANSLATE("Glyph 
hinting:"),
                fHintingMenu);
 
-#ifdef DISABLE_HINTING_CONTROL
        fHintingMenuField->SetEnabled(false);
-#endif
 
        BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, 
B_USE_DEFAULT_SPACING)
        // controls pane
diff --git a/src/servers/app/DesktopSettings.cpp 
b/src/servers/app/DesktopSettings.cpp
index c12eb8c8c8..c92f08c7b4 100644
--- a/src/servers/app/DesktopSettings.cpp
+++ b/src/servers/app/DesktopSettings.cpp
@@ -82,7 +82,7 @@ DesktopSettingsPrivate::_SetDefaults()
        memcpy(fShared.colors, BPrivate::kDefaultColors,
                sizeof(rgb_color) * kColorWhichCount);
 
-       gSubpixelAntialiasing = false;
+       gSubpixelAntialiasing = true;
        gDefaultHintingMode = HINTING_MODE_ON;
        gSubpixelAverageWeight = 120;
        gSubpixelOrderingRGB = true;

############################################################################

Revision:    hrev52737
Commit:      177db1e47fe26cd74d606a79065a5fbdd1f50097
URL:         https://git.haiku-os.org/haiku/commit/?id=177db1e47fe2
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Jan 10 01:35:41 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/14779

app_server: Switch default UI font to Noto Sans Display.

Fixes #14779.

----------------------------------------------------------------------------

diff --git a/src/servers/app/ServerConfig.h b/src/servers/app/ServerConfig.h
index 6416516848..6d1dd65d99 100644
--- a/src/servers/app/ServerConfig.h
+++ b/src/servers/app/ServerConfig.h
@@ -27,11 +27,11 @@
 
 // These definitions provide the server something to use for default
 // system fonts.
-#define DEFAULT_PLAIN_FONT_FAMILY "Noto Sans"
+#define DEFAULT_PLAIN_FONT_FAMILY "Noto Sans Display"
 #define FALLBACK_PLAIN_FONT_FAMILY "Swis721 BT"
 #define DEFAULT_PLAIN_FONT_STYLE "Book"
 #define DEFAULT_PLAIN_FONT_SIZE 12.0f
-#define DEFAULT_BOLD_FONT_FAMILY "Noto Sans"
+#define DEFAULT_BOLD_FONT_FAMILY "Noto Sans Display"
 #define FALLBACK_BOLD_FONT_FAMILY "Swis721 BT"
 #define DEFAULT_BOLD_FONT_STYLE "Bold"
 #define DEFAULT_BOLD_FONT_SIZE 12.0f
diff --git a/src/servers/app/font/FontManager.cpp 
b/src/servers/app/font/FontManager.cpp
index 088b23f81c..7c3a2b30a8 100644
--- a/src/servers/app/font/FontManager.cpp
+++ b/src/servers/app/font/FontManager.cpp
@@ -334,12 +334,12 @@ FontManager::_LoadRecentFontMappings()
                ttfontsPath.Append("ttfonts");
 
                BPath veraFontPath = ttfontsPath;
-               veraFontPath.Append("NotoSans-Regular.ttf");
-               _AddDefaultMapping("Noto Sans", "Book", veraFontPath.Path());
+               veraFontPath.Append("NotoSansDisplay-Regular.ttf");
+               _AddDefaultMapping("Noto Sans Display", "Book", 
veraFontPath.Path());
 
                veraFontPath.SetTo(ttfontsPath.Path());
-               veraFontPath.Append("NotoSans-Bold.ttf");
-               _AddDefaultMapping("Noto Sans", "Bold", veraFontPath.Path());
+               veraFontPath.Append("NotoSansDisplay-Bold.ttf");
+               _AddDefaultMapping("Noto Sans Display", "Bold", 
veraFontPath.Path());
 
                veraFontPath.SetTo(ttfontsPath.Path());
                veraFontPath.Append("NotoMono-Regular.ttf");
diff --git a/src/servers/app/font/GlyphLayoutEngine.h 
b/src/servers/app/font/GlyphLayoutEngine.h
index c3c666c3b3..71d026cb3e 100644
--- a/src/servers/app/font/GlyphLayoutEngine.h
+++ b/src/servers/app/font/GlyphLayoutEngine.h
@@ -324,7 +324,7 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
        // and b) be similar to the original font. So there should be a mapping
        // of some kind to know the most suitable fallback font.
        static const char* fallbacks[] = {
-               "Noto Sans",
+               "Noto Sans Display",
                "Noto Sans CJK JP",
                "Noto Sans Symbols",
                NULL


Other related posts:

  • » [haiku-commits] haiku: hrev52737 - in src: preferences/appearance servers/app/font servers/app - waddlesplash