[feat] Apply @behdad comments

This commit is contained in:
Ebrahim Byagowi 2018-11-01 19:56:16 +03:30 committed by Behdad Esfahbod
parent 3aff3f822f
commit a157b3e4eb
9 changed files with 33 additions and 28 deletions

View File

@ -189,7 +189,7 @@ HB_OT_headers = \
hb-ot-name.h \
hb-ot-shape.h \
hb-ot-var.h \
hb-aat-layout.h \
hb-aat.h \
$(NULL)
# Optional Sources and Headers with external deps

View File

@ -45,6 +45,7 @@ struct SettingName
return_trace (likely (c->check_struct (this)));
}
public:
HBUINT16 setting; /* The setting. */
NameID nameIndex; /* The name table index for the setting's name. */
public:

View File

@ -28,7 +28,7 @@
#include "hb-open-type.hh"
#include "hb-ot-face.hh"
#include "hb-aat-layout.h"
#include "hb-aat.h"
#include "hb-aat-layout.hh"
#include "hb-aat-layout-ankr-table.hh"
#include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise.
@ -307,7 +307,7 @@ _hb_aat_language_get (hb_face_t *face,
}
/**
* hb_aat_get_feature_settings:
* hb_aat_layout_get_feature_settings:
* @face: a font face.
* @identifier: AAT feature id you are querying, for example 1 for
* "Ligatures" feature, 37 for the "Lower Case" feature,
@ -323,12 +323,12 @@ _hb_aat_language_get (hb_face_t *face,
* Since: REPLACEME
*/
unsigned int
hb_aat_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t identifier,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */)
hb_aat_layout_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t identifier,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */)
{
return _get_feat (face).get_settings (identifier, default_setting,
start_offset, records_count, records_buffer);

View File

@ -29,7 +29,7 @@
#include "hb.hh"
#include "hb-aat-layout.h"
#include "hb-aat.h"
#include "hb-ot-shape.hh"

View File

@ -28,7 +28,7 @@
#define HB_AAT_MAP_HH
#include "hb.hh"
#include "hb-aat-layout.h"
#include "hb-aat.h"
struct hb_aat_map_t

View File

@ -22,8 +22,12 @@
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#ifndef HB_AAT_LAYOUT_H
#define HB_AAT_LAYOUT_H
#ifndef HB_OT_H_IN
#error "Include <hb-ot.h> instead."
#endif
#ifndef HB_AAT_H
#define HB_AAT_H
#include "hb.h"
#include "hb-ot.h"
@ -67,13 +71,13 @@ typedef struct hb_aat_feature_type_selector_t
#define HB_AAT_FEATURE_NO_DEFAULT_SETTING ((hb_aat_feature_setting_t) -1)
HB_EXTERN unsigned int
hb_aat_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t type,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */);
hb_aat_layout_get_feature_settings (hb_face_t *face,
hb_aat_feature_type_t type,
hb_aat_feature_setting_t *default_setting, /* OUT. May be NULL. */
unsigned int start_offset,
unsigned int *records_count, /* IN/OUT. May be NULL. */
hb_aat_feature_type_selector_t *records_buffer /* OUT. May be NULL. */);
HB_END_DECLS
#endif /* HB_AAT_LAYOUT_H */
#endif /* HB_AAT_H */

View File

@ -37,6 +37,7 @@
#include "hb-ot-name.h"
#include "hb-ot-shape.h"
#include "hb-ot-var.h"
#include "hb-aat.h"
HB_BEGIN_DECLS

View File

@ -24,9 +24,9 @@
#include "hb-test.h"
#include <hb-aat-layout.h>
#include <hb-ot.h>
/* Unit tests for hb-aat-layout.h */
/* Unit tests for hb-aat.h */
static void
test_aat_get_feature_settings (void)
@ -37,7 +37,7 @@ test_aat_get_feature_settings (void)
hb_face_t *face = hb_test_open_font_file ("fonts/aat-feat.ttf");
g_assert_cmpuint (4, ==, hb_aat_get_feature_settings (face, 18, &default_setting,
g_assert_cmpuint (4, ==, hb_aat_layout_get_feature_settings (face, 18, &default_setting,
0, &count, records));
g_assert_cmpuint (3, ==, count);
g_assert_cmpuint (0, ==, default_setting);
@ -52,7 +52,7 @@ test_aat_get_feature_settings (void)
g_assert_cmpuint (296, ==, records[2].name_id);
count = 3;
g_assert_cmpuint (4, ==, hb_aat_get_feature_settings (face, 18, &default_setting,
g_assert_cmpuint (4, ==, hb_aat_layout_get_feature_settings (face, 18, &default_setting,
3, &count, records));
g_assert_cmpuint (1, ==, count);
g_assert_cmpuint (0, ==, default_setting);
@ -62,7 +62,7 @@ test_aat_get_feature_settings (void)
count = 1;
g_assert_cmpuint (1, ==, hb_aat_get_feature_settings (face, 14, &default_setting,
g_assert_cmpuint (1, ==, hb_aat_layout_get_feature_settings (face, 14, &default_setting,
0, &count, records));
g_assert_cmpuint (1, ==, count);
g_assert_cmpuint (HB_AAT_FEATURE_NO_DEFAULT_SETTING, ==, default_setting);
@ -72,14 +72,14 @@ test_aat_get_feature_settings (void)
count = 100;
g_assert_cmpuint (0, ==, hb_aat_get_feature_settings (face, 32, NULL,
g_assert_cmpuint (0, ==, hb_aat_layout_get_feature_settings (face, 32, NULL,
0, &count, records));
g_assert_cmpuint (0, ==, count);
hb_face_destroy (face);
hb_face_t *sbix = hb_test_open_font_file ("fonts/chromacheck-sbix.ttf");
g_assert_cmpuint (0, ==, hb_aat_get_feature_settings (sbix, 100, NULL,
g_assert_cmpuint (0, ==, hb_aat_layout_get_feature_settings (sbix, 100, NULL,
0, &count, records));
hb_face_destroy (sbix);
}

View File

@ -33,7 +33,6 @@
#include <hb.h>
#include <hb-ot.h>
#include <hb-aat-layout.h>
#ifdef HAVE_GLIB
#include <hb-glib.h>