diff --git a/src/Makefile.sources b/src/Makefile.sources index b3d580db8..c3ec7e83b 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -1,7 +1,6 @@ # Base and default-included sources and headers HB_BASE_sources = \ - hb-aat-fdsc-table.hh \ hb-aat-layout-ankr-table.hh \ hb-aat-layout-bsln-table.hh \ hb-aat-layout-common.hh \ diff --git a/src/hb-aat-fdsc-table.hh b/src/hb-aat-fdsc-table.hh deleted file mode 100644 index 4bc97b742..000000000 --- a/src/hb-aat-fdsc-table.hh +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright © 2018 Ebrahim Byagowi - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - */ - -#ifndef HB_AAT_FDSC_TABLE_HH -#define HB_AAT_FDSC_TABLE_HH - -#include "hb-aat-layout-common.hh" -#include "hb-open-type.hh" - -/* - * fdsc -- Font descriptors - * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fdsc.html - */ -#define HB_AAT_TAG_fdsc HB_TAG('f','d','s','c') - - -namespace AAT { - - -struct FontDescriptor -{ - bool has_data () const { return tag; } - - int cmp (hb_tag_t a) const { return tag.cmp (a); } - - float get_value () const { return u.value.to_float (); } - - enum non_alphabetic_value_t { - Alphabetic = 0, - Dingbats = 1, - PiCharacters = 2, - Fleurons = 3, - DecorativeBorders = 4, - InternationalSymbols= 5, - MathSymbols = 6 - }; - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this)); - } - - protected: - Tag tag; /* The 4-byte table tag name. */ - union { - HBFixed value; /* The value for the descriptor tag. */ - HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */ - } u; - public: - DEFINE_SIZE_STATIC (8); -}; - -struct fdsc -{ - static constexpr hb_tag_t tableTag = HB_AAT_TAG_fdsc; - - enum { - Weight = HB_TAG ('w','g','h','t'), - /* Percent weight relative to regular weight. - * (defaul value: 1.0) */ - Width = HB_TAG ('w','d','t','h'), - /* Percent width relative to regular width. - * (default value: 1.0) */ - Slant = HB_TAG ('s','l','n','t'), - /* Angle of slant in degrees, where positive - * is clockwise from straight up. - * (default value: 0.0) */ - OpticalSize = HB_TAG ('o','p','s','z'), - /* Point size the font was designed for. - * (default value: 12.0) */ - NonAlphabetic= HB_TAG ('n','a','l','f') - /* These values are treated as integers, - * not fixed32s. 0 means alphabetic, and greater - * integers mean the font is non-alphabetic (e.g. symbols). - * (default value: 0) */ - }; - - const FontDescriptor &get_descriptor (hb_tag_t style) const - { return descriptors.lsearch (style); } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - descriptors.sanitize (c)); - } - - protected: - HBFixed version; /* Version number of the font descriptors - * table (0x00010000 for the current version). */ - LArrayOf - descriptors; /* List of tagged-coordinate pairs style descriptors - * that will be included to characterize this font. - * Each descriptor consists of a pair. - * These pairs are located in the gxFontDescriptor - * array that follows. */ - public: - DEFINE_SIZE_ARRAY (8, descriptors); -}; - -} /* namespace AAT */ - - -#endif /* HB_AAT_FDSC_TABLE_HH */ diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index aa753cb86..fac510e9e 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -28,7 +28,6 @@ #include "hb.hh" #include "hb-aat-layout.hh" -#include "hb-aat-fdsc-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-ankr-table.hh" #include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-feat-table.hh" diff --git a/src/hb-ot-face-table-list.hh b/src/hb-ot-face-table-list.hh index 5519d4fdf..5a2a9f1ad 100644 --- a/src/hb-ot-face-table-list.hh +++ b/src/hb-ot-face-table-list.hh @@ -60,7 +60,6 @@ HB_OT_ACCELERATOR (OT, post) HB_OT_ACCELERATOR (OT, name) #endif #ifndef HB_NO_STYLE -HB_OT_TABLE (AAT, fdsc) HB_OT_TABLE (OT, STAT) #endif #ifndef HB_NO_META diff --git a/src/hb-style.cc b/src/hb-style.cc index 69f5beeb2..86b9f7da5 100644 --- a/src/hb-style.cc +++ b/src/hb-style.cc @@ -27,7 +27,6 @@ #ifndef HB_NO_STYLE #ifdef HB_EXPERIMENTAL_API -#include "hb-aat-fdsc-table.hh" #include "hb-ot-var-avar-table.hh" #include "hb-ot-var-fvar-table.hh" #include "hb-ot-stat-table.hh" @@ -106,19 +105,6 @@ hb_style_get_value (hb_font_t *font, hb_tag_t tag) if (face->table.STAT->get_value (style_tag, &value)) return value; - /* Check Apple's fdsc as OS2 table is optional in AAT */ - const AAT::FontDescriptor &descriptor = face->table.fdsc->get_descriptor (style_tag); - if (descriptor.has_data ()) - { - float value = descriptor.get_value (); - /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fdsc.html */ - /* Percent weight relative to regular weight. */ - if (style_tag == HB_STYLE_TAG_WEIGHT) value *= 400.f; - /* Percent width relative to regular width. */ - if (style_tag == HB_STYLE_TAG_WIDTH) value *= 100.f; - return value; - } - switch ((unsigned) style_tag) { case HB_STYLE_TAG_ITALIC: diff --git a/src/meson.build b/src/meson.build index 4f1dfd9ab..3af210be6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,6 +1,5 @@ # Base and default-included sources and headers hb_base_sources = files( - 'hb-aat-fdsc-table.hh', 'hb-aat-layout-ankr-table.hh', 'hb-aat-layout-bsln-table.hh', 'hb-aat-layout-common.hh', diff --git a/test/api/fonts/aat-fdsc.ttf b/test/api/fonts/aat-fdsc.ttf deleted file mode 100644 index 3f82869ea..000000000 Binary files a/test/api/fonts/aat-fdsc.ttf and /dev/null differ diff --git a/test/api/test-style.c b/test/api/test-style.c index b9a406b5e..5e7282491 100644 --- a/test/api/test-style.c +++ b/test/api/test-style.c @@ -65,25 +65,6 @@ test_regular_face (void) hb_face_destroy (face); } -static void -test_face_fdsc (void) -{ - hb_face_t *face = hb_test_open_font_file ("fonts/aat-fdsc.ttf"); - hb_font_t *font = hb_font_create (face); - - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_ITALIC), 0); - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_OPTICAL_SIZE), 24); - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_SLANT), 6.33f); - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_WIDTH), 100); - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_WEIGHT), 400); - - hb_font_set_ptem (font, 36); - assert_cmpfloat (hb_style_get_value (font, HB_STYLE_TAG_OPTICAL_SIZE), 36); - - hb_font_destroy (font); - hb_face_destroy (face); -} - static void test_face_user_setting (void) { @@ -180,7 +161,6 @@ main (int argc, char **argv) hb_test_add (test_empty_face); hb_test_add (test_regular_face); - hb_test_add (test_face_fdsc); hb_test_add (test_face_user_setting); return hb_test_run ();