MozReview-Commit-ID: 56Hspl8LZMY
This commit is contained in:
Phil Ringnalda 2016-10-27 19:21:47 -07:00
Родитель 8071d48314 d61989e28e
Коммит 445097654c
66 изменённых файлов: 2240 добавлений и 407 удалений

Просмотреть файл

@ -31,6 +31,7 @@ const TAB_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.tab_open_event_coun
const WINDOW_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.window_open_event_count";
const UNIQUE_DOMAINS_COUNT_SCALAR_NAME = "browser.engagement.unique_domains_count";
const TOTAL_URI_COUNT_SCALAR_NAME = "browser.engagement.total_uri_count";
const UNFILTERED_URI_COUNT_SCALAR_NAME = "browser.engagement.unfiltered_uri_count";
// A list of known search origins.
const KNOWN_SEARCH_SOURCES = [
@ -78,13 +79,13 @@ let URICountListener = {
// A map to keep track of the URIs loaded from the restored tabs.
_restoredURIsMap: new WeakMap(),
isValidURI(uri) {
isHttpURI(uri) {
// Only consider http(s) schemas.
return uri.schemeIs("http") || uri.schemeIs("https");
},
addRestoredURI(browser, uri) {
if (!this.isValidURI(uri)) {
if (!this.isHttpURI(uri)) {
return;
}
@ -102,10 +103,6 @@ let URICountListener = {
return;
}
if (!this.isValidURI(uri)) {
return;
}
// The SessionStore sets the URI of a tab first, firing onLocationChange the
// first time, then manages content loading using its scheduler. Once content
// loads, we will hit onLocationChange again.
@ -116,14 +113,41 @@ let URICountListener = {
return;
}
// Track URI loads, even if they're not http(s).
let uriSpec = null;
try {
uriSpec = uri.spec;
} catch (e) {
// If we have troubles parsing the spec, still count this as
// an unfiltered URI.
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
return;
}
// Don't count about:blank and similar pages, as they would artificially
// inflate the counts.
if (browser.ownerDocument.defaultView.gInitialPages.includes(uriSpec)) {
return;
}
// If the URI we're loading is in the _restoredURIsMap, then it comes from a
// restored tab. If so, let's skip it and remove it from the map as we want to
// count page refreshes.
if (this._restoredURIsMap.get(browser) === uri.spec) {
if (this._restoredURIsMap.get(browser) === uriSpec) {
this._restoredURIsMap.delete(browser);
return;
}
// The URI wasn't from a restored tab. Count it among the unfiltered URIs.
// If this is an http(s) URI, this also gets counted by the "total_uri_count"
// probe.
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
if (!this.isHttpURI(uri)) {
return;
}
// Update the URI counts.
Services.telemetry.scalarAdd(TOTAL_URI_COUNT_SCALAR_NAME, 1);

Просмотреть файл

@ -6,6 +6,7 @@ const MAX_CONCURRENT_WINDOWS = "browser.engagement.max_concurrent_window_count";
const WINDOW_OPEN_COUNT = "browser.engagement.window_open_event_count";
const TOTAL_URI_COUNT = "browser.engagement.total_uri_count";
const UNIQUE_DOMAINS_COUNT = "browser.engagement.unique_domains_count";
const UNFILTERED_URI_COUNT = "browser.engagement.unfiltered_uri_count";
const TELEMETRY_SUBSESSION_TOPIC = "internal-telemetry-after-subsession-split";
@ -59,23 +60,25 @@ let checkScalar = (scalars, scalarName, value, msg) => {
/**
* Get a snapshot of the scalars and check them against the provided values.
*/
let checkScalars = (maxTabs, tabOpenCount, maxWindows, windowsOpenCount, totalURIs, domainCount) => {
let checkScalars = (countsObject) => {
const scalars =
Services.telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
// Check the expected values. Scalars that are never set must not be reported.
checkScalar(scalars, MAX_CONCURRENT_TABS, maxTabs,
checkScalar(scalars, MAX_CONCURRENT_TABS, countsObject.maxTabs,
"The maximum tab count must match the expected value.");
checkScalar(scalars, TAB_EVENT_COUNT, tabOpenCount,
checkScalar(scalars, TAB_EVENT_COUNT, countsObject.tabOpenCount,
"The number of open tab event count must match the expected value.");
checkScalar(scalars, MAX_CONCURRENT_WINDOWS, maxWindows,
checkScalar(scalars, MAX_CONCURRENT_WINDOWS, countsObject.maxWindows,
"The maximum window count must match the expected value.");
checkScalar(scalars, WINDOW_OPEN_COUNT, windowsOpenCount,
checkScalar(scalars, WINDOW_OPEN_COUNT, countsObject.windowsOpenCount,
"The number of window open event count must match the expected value.");
checkScalar(scalars, TOTAL_URI_COUNT, totalURIs,
checkScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The total URI count must match the expected value.");
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, domainCount,
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains count must match the expected value.");
checkScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI count must match the expected value.");
};
add_task(function* test_tabsAndWindows() {
@ -92,14 +95,20 @@ add_task(function* test_tabsAndWindows() {
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank"));
expectedTabOpenCount = 1;
expectedMaxTabs = 2;
checkScalars(expectedMaxTabs, expectedTabOpenCount, expectedMaxWins, expectedWinOpenCount, 0, 0);
// This, and all the checks below, also check that initial pages (about:newtab, about:blank, ..)
// are not counted by the total_uri_count and the unfiltered_uri_count probes.
checkScalars({maxTabs: expectedMaxTabs, tabOpenCount: expectedTabOpenCount, maxWindows: expectedMaxWins,
windowsOpenCount: expectedWinOpenCount, totalURIs: 0, domainCount: 0,
totalUnfilteredURIs: 0});
// Add two new tabs in the same window.
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank"));
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank"));
expectedTabOpenCount += 2;
expectedMaxTabs += 2;
checkScalars(expectedMaxTabs, expectedTabOpenCount, expectedMaxWins, expectedWinOpenCount, 0, 0);
checkScalars({maxTabs: expectedMaxTabs, tabOpenCount: expectedTabOpenCount, maxWindows: expectedMaxWins,
windowsOpenCount: expectedWinOpenCount, totalURIs: 0, domainCount: 0,
totalUnfilteredURIs: 0});
// Add a new window and then some tabs in it. An empty new windows counts as a tab.
let win = yield BrowserTestUtils.openNewBrowserWindow();
@ -114,7 +123,9 @@ add_task(function* test_tabsAndWindows() {
// Remove a tab from the first window, the max shouldn't change.
yield BrowserTestUtils.removeTab(openedTabs.pop());
checkScalars(expectedMaxTabs, expectedTabOpenCount, expectedMaxWins, expectedWinOpenCount, 0, 0);
checkScalars({maxTabs: expectedMaxTabs, tabOpenCount: expectedTabOpenCount, maxWindows: expectedMaxWins,
windowsOpenCount: expectedWinOpenCount, totalURIs: 0, domainCount: 0,
totalUnfilteredURIs: 0});
// Remove all the extra windows and tabs.
for (let tab of openedTabs) {
@ -123,7 +134,9 @@ add_task(function* test_tabsAndWindows() {
yield BrowserTestUtils.closeWindow(win);
// Make sure all the scalars still have the expected values.
checkScalars(expectedMaxTabs, expectedTabOpenCount, expectedMaxWins, expectedWinOpenCount, 0, 0);
checkScalars({maxTabs: expectedMaxTabs, tabOpenCount: expectedTabOpenCount, maxWindows: expectedMaxWins,
windowsOpenCount: expectedWinOpenCount, totalURIs: 0, domainCount: 0,
totalUnfilteredURIs: 0});
});
add_task(function* test_subsessionSplit() {
@ -134,12 +147,14 @@ add_task(function* test_subsessionSplit() {
let win = yield BrowserTestUtils.openNewBrowserWindow();
let openedTabs = [];
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:blank"));
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:blank"));
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:mozilla"));
openedTabs.push(yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "http://www.example.com"));
// Check that the scalars have the right values.
checkScalars(5 /*maxTabs*/, 4 /*tabOpen*/, 2 /*maxWins*/, 1 /*winOpen*/,
1 /* toalURIs */, 1 /* uniqueDomains */);
// Check that the scalars have the right values. We expect 2 unfiltered URI loads
// (about:mozilla and www.example.com, but no about:blank) and 1 URI totalURIs
// (only www.example.com).
checkScalars({maxTabs: 5, tabOpenCount: 4, maxWindows: 2, windowsOpenCount: 1,
totalURIs: 1, domainCount: 1, totalUnfilteredURIs: 2});
// Remove a tab.
yield BrowserTestUtils.removeTab(openedTabs.pop());
@ -151,10 +166,10 @@ add_task(function* test_subsessionSplit() {
Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC, "");
// After a subsession split, only the MAX_CONCURRENT_* scalars must be available
// and have the correct value. No tabs or windows were opened so other scalars
// and have the correct value. No tabs, windows or URIs were opened so other scalars
// must not be reported.
checkScalars(4 /*maxTabs*/, 0 /*tabOpen*/, 2 /*maxWins*/, 0 /*winOpen*/,
0 /* toalURIs */, 0 /* uniqueDomains */);
checkScalars({maxTabs: 4, tabOpenCount: 0, maxWindows: 2, windowsOpenCount: 0,
totalURIs: 0, domainCount: 0, totalUnfilteredURIs: 0});
// Remove all the extra windows and tabs.
for (let tab of openedTabs) {
@ -167,36 +182,38 @@ add_task(function* test_URIAndDomainCounts() {
// Let's reset the counts.
Services.telemetry.clearScalars();
let checkCounts = (URICount, domainCount) => {
let checkCounts = (countsObject) => {
// Get a snapshot of the scalars and then clear them.
const scalars =
Services.telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
checkScalar(scalars, TOTAL_URI_COUNT, URICount,
checkScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The URI scalar must contain the expected value.");
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, domainCount,
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains scalar must contain the expected value.");
checkScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI scalar must contain the expected value.");
};
// Check that about:blank doesn't get counted in the URI total.
let firstTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
checkCounts(0, 0);
checkCounts({totalURIs: 0, domainCount: 0, totalUnfilteredURIs: 0});
// Open a different page and check the counts.
yield BrowserTestUtils.loadURI(firstTab.linkedBrowser, "http://example.com/");
yield BrowserTestUtils.browserLoaded(firstTab.linkedBrowser);
checkCounts(1, 1);
checkCounts({totalURIs: 1, domainCount: 1, totalUnfilteredURIs: 1});
// Activating a different tab must not increase the URI count.
let secondTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
yield BrowserTestUtils.switchTab(gBrowser, firstTab);
checkCounts(1, 1);
checkCounts({totalURIs: 1, domainCount: 1, totalUnfilteredURIs: 1});
yield BrowserTestUtils.removeTab(secondTab);
// Open a new window and set the tab to a new address.
let newWin = yield BrowserTestUtils.openNewBrowserWindow();
yield BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, "http://example.com/");
yield BrowserTestUtils.browserLoaded(newWin.gBrowser.selectedBrowser);
checkCounts(2, 1);
checkCounts({totalURIs: 2, domainCount: 1, totalUnfilteredURIs: 2});
// We should not count AJAX requests.
const XHR_URL = "http://example.com/r";
@ -208,23 +225,23 @@ add_task(function* test_URIAndDomainCounts() {
xhr.send();
});
});
checkCounts(2, 1);
checkCounts({totalURIs: 2, domainCount: 1, totalUnfilteredURIs: 2});
// Check that we're counting page fragments.
let loadingStopped = browserLocationChanged(newWin.gBrowser.selectedBrowser);
yield BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, "http://example.com/#2");
yield loadingStopped;
checkCounts(3, 1);
checkCounts({totalURIs: 3, domainCount: 1, totalUnfilteredURIs: 3});
// Check test.domain.com and some.domain.com are only counted once unique.
// Check that a different URI from the example.com domain doesn't increment the unique count.
yield BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, "http://test1.example.com/");
yield BrowserTestUtils.browserLoaded(newWin.gBrowser.selectedBrowser);
checkCounts(4, 1);
checkCounts({totalURIs: 4, domainCount: 1, totalUnfilteredURIs: 4});
// Make sure that the unique domains counter is incrementing for a different domain.
yield BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, "https://example.org/");
yield BrowserTestUtils.browserLoaded(newWin.gBrowser.selectedBrowser);
checkCounts(5, 2);
checkCounts({totalURIs: 5, domainCount: 2, totalUnfilteredURIs: 5});
// Check that we only account for top level loads (e.g. we don't count URIs from
// embedded iframes).
@ -236,7 +253,14 @@ add_task(function* test_URIAndDomainCounts() {
doc.body.insertBefore(iframe, doc.body.firstChild);
yield promiseIframeLoaded;
});
checkCounts(5, 2);
checkCounts({totalURIs: 5, domainCount: 2, totalUnfilteredURIs: 5});
// Check that uncommon protocols get counted in the unfiltered URI probe.
const TEST_PAGE =
"data:text/html,<a id='target' href='%23par1'>Click me</a><a name='par1'>The paragraph.</a>";
yield BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, TEST_PAGE);
yield BrowserTestUtils.browserLoaded(newWin.gBrowser.selectedBrowser);
checkCounts({totalURIs: 5, domainCount: 2, totalUnfilteredURIs: 6});
// Clean up.
yield BrowserTestUtils.removeTab(firstTab);

Просмотреть файл

@ -5,6 +5,7 @@ const TAB_EVENT_COUNT = "browser.engagement.tab_open_event_count";
const MAX_CONCURRENT_WINDOWS = "browser.engagement.max_concurrent_window_count";
const WINDOW_OPEN_COUNT = "browser.engagement.window_open_event_count";
const TOTAL_URI_COUNT = "browser.engagement.total_uri_count";
const UNFILTERED_URI_COUNT = "browser.engagement.unfiltered_uri_count";
const UNIQUE_DOMAINS_COUNT = "browser.engagement.unique_domains_count";
function promiseBrowserStateRestored() {
@ -30,6 +31,7 @@ add_task(function* test_privateMode() {
Services.telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
ok(!(TOTAL_URI_COUNT in scalars), "We should not track URIs in private mode.");
ok(!(UNFILTERED_URI_COUNT in scalars), "We should not track URIs in private mode.");
ok(!(UNIQUE_DOMAINS_COUNT in scalars), "We should not track unique domains in private mode.");
is(scalars[TAB_EVENT_COUNT], 1, "The number of open tab event count must match the expected value.");
is(scalars[MAX_CONCURRENT_TABS], 2, "The maximum tab count must match the expected value.");
@ -79,6 +81,7 @@ add_task(function* test_sessionRestore() {
Services.telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
ok(!(TOTAL_URI_COUNT in scalars), "We should not track URIs from restored sessions.");
ok(!(UNFILTERED_URI_COUNT in scalars), "We should not track URIs from restored sessions.");
ok(!(UNIQUE_DOMAINS_COUNT in scalars), "We should not track unique domains from restored sessions.");
// Restore the original session and cleanup.

Просмотреть файл

@ -1,3 +1,3 @@
#define ANGLE_COMMIT_HASH ""
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE ""
#define ANGLE_COMMIT_HASH ""
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE ""

0
gfx/angle/src/compiler/translator/RenameFunction.h Executable file → Normal file
Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -2,32 +2,27 @@
NULL =
SUBDIRS = src util test
ACLOCAL_AMFLAGS = -I m4
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = harfbuzz.pc
SUBDIRS = src util test docs win32
EXTRA_DIST = \
autogen.sh \
harfbuzz.doap \
Android.mk \
README.python \
BUILD.md \
$(NULL)
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
$(srcdir)/INSTALL \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.sub \
$(srcdir)/configure.scan \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/ChangeLog \
`find "$(srcdir)" -type f -name Makefile.in -print`
$(srcdir)/gtk-doc.make \
$(srcdir)/m4/gtk-doc.m4 \
$(NULL)
#
@ -36,28 +31,37 @@ MAINTAINERCLEANFILES = \
CHANGELOG_RANGE =
ChangeLog: $(srcdir)/ChangeLog
$(srcdir)/ChangeLog:
$(AM_V_GEN) if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run \
git log $(CHANGELOG_RANGE) --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
$(AM_V_GEN) if test -d "$(top_srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git \
$(GIT) log $(CHANGELOG_RANGE) --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp "$(srcdir)/ChangeLog" \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
(test -f $@ || echo git-log is required to generate this file >> "$(srcdir)/$@")); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
echo A git checkout and git-log is required to generate this file >> "$(srcdir)/$@"); \
fi
.PHONY: $(srcdir)/ChangeLog
.PHONY: ChangeLog $(srcdir)/ChangeLog
#
# Release engineering
#
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--disable-doc-cross-references \
--with-gobject \
--enable-introspection \
$(NULL)
# TODO: Copy infrastructure from cairo
# TAR_OPTIONS is not set as env var for 'make dist'. How to fix that?
TAR_OPTIONS = --owner=0 --group=0
dist-hook: dist-clear-sticky-bits
# Clean up any sticky bits we may inherit from parent dir
dist-clear-sticky-bits:

Просмотреть файл

@ -1,3 +1,8 @@
[![Build Status](https://travis-ci.org/behdad/harfbuzz.svg)](https://travis-ci.org/behdad/harfbuzz)
[![Build Status](https://ci.appveyor.com/api/projects/status/4oaq58ns2h0m2soa?svg=true)](https://ci.appveyor.com/project/behdad/harfbuzz)
[![Coverage Status](https://img.shields.io/coveralls/behdad/harfbuzz.svg)](https://coveralls.io/r/behdad/harfbuzz)
[ABI Tracker](http://abi-laboratory.pro/tracker/timeline/harfbuzz/)
This is HarfBuzz, a text shaping library.
For bug reports, mailing list, and other information please visit:

Просмотреть файл

@ -1,12 +1,9 @@
gfx/harfbuzz status as of 2016-08-21:
gfx/harfbuzz status as of 2016-10-26:
This directory contains the harfbuzz source from the 'master' branch of
https://github.com/behdad/harfbuzz.
Current version: 1.3.0 + recent fixes from trunk,
up to 547ddb0721365dca985aef5b759d08718f7c5f82
+ the relevant part of https://github.com/behdad/harfbuzz/pull/334.
Current version: 1.3.3
UPDATING:

Просмотреть файл

@ -1,70 +1,55 @@
General fixes:
=============
- Move feature parsing from util into the library
- AAT 'morx' implementation.
- Return "safe-to-break" bit from shaping.
- Implement 'rand' feature.
- mask propagation? (when ligation, "or" the masks).
API issues:
===========
- API to accept a list of languages?
- Add init_func to font_funcs. Adjust ft.
- 'const' for getter APIs? (use mutable internally)
- Fix TT 'kern' on/off and GPOS interaction (move kerning before GPOS)
- Do proper rounding when scaling from font space?
- Misc features:
* init/medi/fina/isol for non-cursive scripts
* vkna,hkna etc for kana, *jmo for hangul, etc
- Move non-native direction and normalization handling to the generic non-OT
layer, such that uniscribe and other backends can use.
- Uniscribe backend needs to enforce one direction only, otherwise cluster
values can confused the user.
- Remove hb_ot_shape_glyphs_closure()?
API issues to fix before 1.0:
============================
API additions
=============
- Rename all internal symbols (static ones even) to have _hb prefix?
- Language to/from script.
- Add pkg-config files for glue codes (harfbuzz-glib, etc)
- Figure out how many .so objects, how to link, etc
- blob_from_file?
- Add hb-cairo glue
- Add sanitize API (and a cached version, that saves result on blob user-data)
- Add glib GBoxedType stuff and introspection
API to add (maybe after 1.0):
============================
- Add Uniscribe face / font get API
- BCP 47 language handling / API (language_matches?)
- Add hb_face_get_glyph_count()?
- Add hb_font_create_unscaled()?
- Add hb_font_create_linear()?
- Add hb_shape_plan()/hb_shape_execute()
- Add query API for aalt-like features?
- Add query / enumeration API for aalt-like features?
- SFNT api? get_num_faces? get_table_tags? (there's something in stash)
- Add segmentation API
- Add hb-fribidi?
- Add hb-fribidi glue?
hb-view enhancements:
====================
hb-view / hb-shape enhancements:
===============================
- Add --format
- Add --width, --height, --auto-size, --align, etc?
- Port to GOption, --help
- Add XML and JSON formats
- Add --width, --height, --auto-size, --ink-box, --align, etc?
Tests to write:
@ -76,10 +61,9 @@ Tests to write:
- Finish test-unicode.c, grep for TODO
- GObject, FreeType, etc
Optimizations:
=============
- hb_cache_t and relatives
- Avoid allocating blob objects internally for for_data() faces?
- Add caching layer to hb-ft
- hb_feature_to/from_string
- hb_buffer_[sg]et_contents

Просмотреть файл

@ -19,9 +19,22 @@ which pkg-config || {
exit 1
}
echo -n "checking for libtoolize... "
which glibtoolize || which libtoolize || {
echo "*** No libtoolize (libtool) found, please install it ***"
exit 1
}
echo -n "checking for gtkdocize... "
if which gtkdocize ; then
gtkdocize --copy || exit 1
else
echo "*** No gtkdocize (gtk-doc) found, skipping documentation ***"
echo "EXTRA_DIST = " > gtk-doc.make
fi
echo -n "checking for autoreconf... "
which autoreconf || {
echo "*** No autoreconf found, please install it ***"
echo "*** No autoreconf (autoconf) found, please install it ***"
exit 1
}

Просмотреть файл

@ -1,24 +1,32 @@
AC_PREREQ([2.64])
AC_INIT([harfbuzz],
[0.7.0],
[http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
AC_INIT([HarfBuzz],
[1.3.3],
[https://github.com/behdad/harfbuzz/issues/new],
[harfbuzz],
[http://harfbuzz.org/])
AC_CONFIG_SRCDIR([harfbuzz.pc.in])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/harfbuzz.pc.in])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11.1 gnu dist-bzip2 no-dist-gzip -Wall no-define])
AM_INIT_AUTOMAKE([1.11.1 gnits tar-ustar dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability])
AM_CONDITIONAL(AUTOMAKE_OLDER_THAN_1_13, test $am__api_version = 1.11 -o $am__api_version = 1.12)
AM_SILENT_RULES([yes])
# Initialize libtool
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_PREREQ([2.2])
LT_INIT([disable-static])
# Check for programs
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])
AC_SYS_LARGEFILE
PKG_PROG_PKG_CONFIG([0.20])
AM_MISSING_PROG([RAGEL], [ragel])
AM_MISSING_PROG([GIT], [git])
# Version
m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
@ -45,18 +53,28 @@ m4_if(m4_eval(hb_version_minor % 2), [1],
m4_define([hb_libtool_age],
m4_eval(hb_version_int - hb_libtool_revision))
m4_define([hb_libtool_current],
m4_eval(hb_version_major + hb_libtool_age))
m4_eval(hb_libtool_age))
HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age
AC_SUBST(HB_LIBTOOL_VERSION_INFO)
dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
# Documentation
have_gtk_doc=false
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
if test "x$enable_gtk_doc" = xyes; then
have_gtk_doc=true
fi
], [
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
# Functions and headers
AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap _setmode)
AC_CHECK_HEADERS(unistd.h sys/mman.h io.h)
AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty)
AC_CHECK_HEADERS(unistd.h sys/mman.h)
# Compiler flags
AC_CANONICAL_HOST
AC_CHECK_ALIGNOF([struct{char;}])
if test "x$GCC" = "xyes"; then
# Make symbols link locally
@ -65,29 +83,96 @@ if test "x$GCC" = "xyes"; then
# Make sure we don't link to libstdc++
CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
# Assorted warnings
CXXFLAGS="$CXXFLAGS -Wcast-align"
case "$host" in
*-*-mingw*)
;;
*)
# Hide inline methods
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
;;
esac
case "$host" in
arm-*-*)
# Request byte alignment on arm
CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
if test "x$ac_cv_alignof_struct_char__" != x1; then
# Request byte alignment
CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
fi
;;
esac
fi
AM_CONDITIONAL(HAVE_GCC, test "x$GCC" = "xyes")
hb_os_win32=no
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
hb_os_win32=yes
;;
esac
AC_MSG_RESULT([$hb_os_win32])
AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes")
have_pthread=false
if test "$hb_os_win32" = no; then
AX_PTHREAD([have_pthread=true])
fi
if $have_pthread; then
AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads])
fi
AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread)
dnl ==========================================================================
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
have_ot=true
if $have_ot; then
AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend])
fi
AM_CONDITIONAL(HAVE_OT, $have_ot)
have_fallback=true
if $have_fallback; then
AC_DEFINE(HAVE_FALLBACK, 1, [Have simple TrueType Layout backend])
fi
AM_CONDITIONAL(HAVE_FALLBACK, $have_fallback)
dnl ===========================================================================
AC_ARG_WITH(glib,
[AS_HELP_STRING([--with-glib=@<:@yes/no/auto@:>@],
[Use glib @<:@default=auto@:>@])],,
[with_glib=auto])
have_glib=false
GLIB_DEPS="glib-2.0 >= 2.38"
AC_SUBST(GLIB_DEPS)
if test "x$with_glib" = "xyes" -o "x$with_glib" = "xauto"; then
PKG_CHECK_MODULES(GLIB, $GLIB_DEPS, have_glib=true, :)
fi
if test "x$with_glib" = "xyes" -a "x$have_glib" != "xtrue"; then
AC_MSG_ERROR([glib support requested but glib-2.0 not found])
fi
if $have_glib; then
AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
fi
AM_CONDITIONAL(HAVE_GLIB, $have_glib)
PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false)
if $have_gthread; then
AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library])
fi
AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread)
dnl ===========================================================================
PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0 >= 2.16, have_gobject=true, have_gobject=false)
AC_ARG_WITH(gobject,
[AS_HELP_STRING([--with-gobject=@<:@yes/no/auto@:>@],
[Use gobject @<:@default=auto@:>@])],,
[with_gobject=no])
have_gobject=false
if test "x$with_gobject" = "xyes" -o "x$with_gobject" = "xauto"; then
PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0, have_gobject=true, :)
fi
if test "x$with_gobject" = "xyes" -a "x$have_gobject" != "xtrue"; then
AC_MSG_ERROR([gobject support requested but gobject-2.0 / glib-2.0 not found])
fi
if $have_gobject; then
AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library])
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
@ -95,15 +180,47 @@ if $have_gobject; then
fi
AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject)
dnl ===========================================================================
dnl ===========================================================================
# Gobject-Introspection
have_introspection=false
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
if $have_gobject; then
GOBJECT_INTROSPECTION_CHECK([1.34.0])
if test "x$found_introspection" = xyes; then
have_introspection=true
fi
else
AM_CONDITIONAL([HAVE_INTROSPECTION], false)
fi
], [
AM_CONDITIONAL([HAVE_INTROSPECTION], false)
])
dnl ==========================================================================
PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false)
AC_ARG_WITH(cairo,
[AS_HELP_STRING([--with-cairo=@<:@yes/no/auto@:>@],
[Use cairo @<:@default=auto@:>@])],,
[with_cairo=auto])
have_cairo=false
if test "x$with_cairo" = "xyes" -o "x$with_cairo" = "xauto"; then
PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, :)
fi
if test "x$with_cairo" = "xyes" -a "x$have_cairo" != "xtrue"; then
AC_MSG_ERROR([cairo support requested but not found])
fi
if $have_cairo; then
AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library])
fi
AM_CONDITIONAL(HAVE_CAIRO, $have_cairo)
PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false)
have_cairo_ft=false
if $have_cairo; then
PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, :)
fi
if $have_cairo_ft; then
AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library])
fi
@ -111,79 +228,296 @@ AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
dnl ==========================================================================
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
have_icu=true
AC_CHECK_HEADERS(unicode/uchar.h,, have_icu=false)
AC_MSG_CHECKING([for libicuuc])
LIBS_old=$LIBS
LIBS="$LIBS -licuuc"
AC_TRY_LINK([#include <unicode/uchar.h>],
[u_getIntPropertyValue (0, (UProperty)0);],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no);have_icu=false)
LIBS=$LIBS_old
if $have_icu; then
ICU_CFLAGS=-D_REENTRANT
ICU_LIBS="-licuuc"
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
AC_ARG_WITH(fontconfig,
[AS_HELP_STRING([--with-fontconfig=@<:@yes/no/auto@:>@],
[Use fontconfig @<:@default=auto@:>@])],,
[with_fontconfig=auto])
have_fontconfig=false
if test "x$with_fontconfig" = "xyes" -o "x$with_fontconfig" = "xauto"; then
PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fontconfig=true, :)
fi
if test "x$with_fontconfig" = "xyes" -a "x$have_fontconfig" != "xtrue"; then
AC_MSG_ERROR([fontconfig support requested but not found])
fi
if $have_fontconfig; then
AC_DEFINE(HAVE_FONTCONFIG, 1, [Have fontconfig library])
fi
AM_CONDITIONAL(HAVE_FONTCONFIG, $have_fontconfig)
dnl ==========================================================================
AC_ARG_WITH(icu,
[AS_HELP_STRING([--with-icu=@<:@yes/no/builtin/auto@:>@],
[Use ICU @<:@default=auto@:>@])],,
[with_icu=auto])
have_icu=false
if test "x$with_icu" = "xyes" -o "x$with_icu" = "xbuiltin" -o "x$with_icu" = "xauto"; then
PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, :)
dnl Fallback to icu-config if ICU pkg-config files could not be found
if test "$have_icu" != "true"; then
AC_CHECK_TOOL(ICU_CONFIG, icu-config, no)
AC_MSG_CHECKING([for ICU by using icu-config fallback])
if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then
have_icu=true
# We don't use --cflags as this gives us a lot of things that we don't
# necessarily want, like debugging and optimization flags
# See man (1) icu-config for more info.
ICU_CFLAGS=`$ICU_CONFIG --cppflags`
ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly`
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
])
fi
if test \( "x$with_icu" = "xyes" -o "x$with_icu" = "xbuiltin" \) -a "x$have_icu" != "xtrue"; then
AC_MSG_ERROR([icu support requested but icu-uc not found])
fi
if $have_icu; then
CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`"
AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
if test "x$with_icu" = "xbuiltin"; then
AC_DEFINE(HAVE_ICU_BUILTIN, 1, [Use hb-icu Unicode callbacks])
fi
fi
AM_CONDITIONAL(HAVE_ICU, $have_icu)
AM_CONDITIONAL(HAVE_ICU_BUILTIN, $have_icu && test "x$with_icu" = "xbuiltin")
dnl ==========================================================================
dnl ===========================================================================
PKG_CHECK_MODULES(GRAPHITE, graphite2, have_graphite=true, have_graphite=false)
if $have_graphite; then
AC_DEFINE(HAVE_GRAPHITE, 1, [Have Graphite library])
have_ucdn=true
if $have_glib || test \( $have_icu -a "x$with_icu" = "xbuiltin" \); then
have_ucdn=false
fi
AM_CONDITIONAL(HAVE_GRAPHITE, $have_graphite)
if $have_ucdn; then
AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions])
fi
AM_CONDITIONAL(HAVE_UCDN, $have_ucdn)
dnl ==========================================================================
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false)
AC_ARG_WITH(graphite2,
[AS_HELP_STRING([--with-graphite2=@<:@yes/no/auto@:>@],
[Use the graphite2 library @<:@default=no@:>@])],,
[with_graphite2=no])
have_graphite2=false
GRAPHITE2_DEPS="graphite2"
AC_SUBST(GRAPHITE2_DEPS)
if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then
PKG_CHECK_MODULES(GRAPHITE2, $GRAPHITE2_DEPS, have_graphite2=true, :)
if test "x$have_graphite2" != "xtrue"; then
# If pkg-config is not available, graphite2 can still be there
ac_save_CFLAGS="$CFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
CFLAGS="$CFLAGS $GRAPHITE2_CFLAGS"
CPPFLAGS="$CPPFLAGS $GRAPHITE2_CFLAGS"
AC_CHECK_HEADER(graphite2/Segment.h, have_graphite2=true, :)
CPPFLAGS="$ac_save_CPPFLAGS"
CFLAGS="$ac_save_CFLAGS"
fi
fi
if test "x$with_graphite2" = "xyes" -a "x$have_graphite2" != "xtrue"; then
AC_MSG_ERROR([graphite2 support requested but libgraphite2 not found])
fi
if $have_graphite2; then
AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite2 library])
fi
AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite2)
dnl ==========================================================================
AC_ARG_WITH(freetype,
[AS_HELP_STRING([--with-freetype=@<:@yes/no/auto@:>@],
[Use the FreeType library @<:@default=auto@:>@])],,
[with_freetype=auto])
have_freetype=false
FREETYPE_DEPS="freetype2 >= 12.0.6"
AC_SUBST(FREETYPE_DEPS)
if test "x$with_freetype" = "xyes" -o "x$with_freetype" = "xauto"; then
# See freetype/docs/VERSION.DLL; 12.0.6 means freetype-2.4.2
PKG_CHECK_MODULES(FREETYPE, $FREETYPE_DEPS, have_freetype=true, :)
fi
if test "x$with_freetype" = "xyes" -a "x$have_freetype" != "xtrue"; then
AC_MSG_ERROR([FreeType support requested but libfreetype2 not found])
fi
if $have_freetype; then
AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
_save_libs="$LIBS"
_save_cflags="$CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS"
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
LIBS="$_save_libs"
CFLAGS="$_save_cflags"
fi
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)
dnl ===========================================================================
have_ot=true;
if $have_ot; then
AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend])
AC_ARG_WITH(uniscribe,
[AS_HELP_STRING([--with-uniscribe=@<:@yes/no/auto@:>@],
[Use the Uniscribe library @<:@default=no@:>@])],,
[with_uniscribe=no])
have_uniscribe=false
if test "x$with_uniscribe" = "xyes" -o "x$with_uniscribe" = "xauto"; then
AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true)
fi
if test "x$with_uniscribe" = "xyes" -a "x$have_uniscribe" != "xtrue"; then
AC_MSG_ERROR([uniscribe support requested but not found])
fi
AM_CONDITIONAL(HAVE_OT, $have_ot)
dnl ===========================================================================
AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true, have_uniscribe=false)
if $have_uniscribe; then
UNISCRIBE_CFLAGS=
UNISCRIBE_LIBS="-lusp10 -lgdi32"
UNISCRIBE_LIBS="-lusp10 -lgdi32 -lrpcrt4"
AC_SUBST(UNISCRIBE_CFLAGS)
AC_SUBST(UNISCRIBE_LIBS)
AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend])
AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe library])
fi
AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)
dnl ===========================================================================
AC_ARG_WITH(directwrite,
[AS_HELP_STRING([--with-directwrite=@<:@yes/no/auto@:>@],
[Use the DirectWrite library (experimental) @<:@default=no@:>@])],,
[with_directwrite=no])
have_directwrite=false
AC_LANG_PUSH([C++])
if test "x$with_directwrite" = "xyes" -o "x$with_directwrite" = "xauto"; then
AC_CHECK_HEADERS(dwrite.h, have_directwrite=true)
fi
AC_LANG_POP([C++])
if test "x$with_directwrite" = "xyes" -a "x$have_directwrite" != "xtrue"; then
AC_MSG_ERROR([directwrite support requested but not found])
fi
if $have_directwrite; then
DIRECTWRITE_CXXFLAGS=
DIRECTWRITE_LIBS="-ldwrite"
AC_SUBST(DIRECTWRITE_CXXFLAGS)
AC_SUBST(DIRECTWRITE_LIBS)
AC_DEFINE(HAVE_DIRECTWRITE, 1, [Have DirectWrite library])
fi
AM_CONDITIONAL(HAVE_DIRECTWRITE, $have_directwrite)
dnl ===========================================================================
AC_ARG_WITH(coretext,
[AS_HELP_STRING([--with-coretext=@<:@yes/no/auto@:>@],
[Use CoreText @<:@default=no@:>@])],,
[with_coretext=no])
have_coretext=false
if test "x$with_coretext" = "xyes" -o "x$with_coretext" = "xauto"; then
AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <ApplicationServices/ApplicationServices.h>])
if $have_coretext; then
CORETEXT_CFLAGS=
CORETEXT_LIBS="-framework ApplicationServices"
AC_SUBST(CORETEXT_CFLAGS)
AC_SUBST(CORETEXT_LIBS)
else
# On iOS CoreText and CoreGraphics are stand-alone frameworks
if test "x$have_coretext" != "xtrue"; then
# Check for a different symbol to avoid getting cached result.
AC_CHECK_TYPE(CTRunRef, have_coretext=true,, [#include <CoreText/CoreText.h>])
fi
if $have_coretext; then
CORETEXT_CFLAGS=
CORETEXT_LIBS="-framework CoreText -framework CoreGraphics"
AC_SUBST(CORETEXT_CFLAGS)
AC_SUBST(CORETEXT_LIBS)
fi
fi
fi
if test "x$with_coretext" = "xyes" -a "x$have_coretext" != "xtrue"; then
AC_MSG_ERROR([CoreText support requested but libcoretext not found])
fi
if $have_coretext; then
AC_DEFINE(HAVE_CORETEXT, 1, [Have Core Text backend])
fi
AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext)
dnl ===========================================================================
AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [
hb_cv_have_intel_atomic_primitives=false
AC_TRY_LINK([
void memory_barrier (void) { __sync_synchronize (); }
int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); }
int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); }
void mutex_unlock (int *m) { __sync_lock_release (m); }
], [], hb_cv_have_intel_atomic_primitives=true
)
])
if $hb_cv_have_intel_atomic_primitives; then
AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, [Have Intel __sync_* atomic primitives])
fi
dnl ===========================================================================
AC_CACHE_CHECK([for Solaris atomic operations], hb_cv_have_solaris_atomic_ops, [
hb_cv_have_solaris_atomic_ops=false
AC_TRY_LINK([
#include <atomic.h>
/* This requires Solaris Studio 12.2 or newer: */
#include <mbarrier.h>
void memory_barrier (void) { __machine_rw_barrier (); }
int atomic_add (volatile unsigned *i) { return atomic_add_int_nv (i, 1); }
void *atomic_ptr_cmpxchg (volatile void **target, void *cmp, void *newval) { return atomic_cas_ptr (target, cmp, newval); }
], [], hb_cv_have_solaris_atomic_ops=true
)
])
if $hb_cv_have_solaris_atomic_ops; then
AC_DEFINE(HAVE_SOLARIS_ATOMIC_OPS, 1, [Have Solaris __machine_*_barrier and atomic_* operations])
fi
if test "$os_win32" = no && ! $have_pthread; then
AC_CHECK_HEADERS(sched.h)
AC_SEARCH_LIBS(sched_yield,rt,AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield]))
fi
dnl ===========================================================================
AC_CONFIG_FILES([
Makefile
harfbuzz.pc
src/Makefile
src/hb-version.h
src/hb-ucdn/Makefile
util/Makefile
test/Makefile
test/api/Makefile
test/fuzzing/Makefile
test/shaping/Makefile
docs/Makefile
docs/version.xml
win32/Makefile
win32/config.h.win32
])
AC_OUTPUT
AC_MSG_NOTICE([
Build configuration:
Unicode callbacks (you want at least one):
Glib: ${have_glib}
ICU: ${have_icu}
UCDN: ${have_ucdn}
Font callbacks (the more the better):
FreeType: ${have_freetype}
Tools used for command-line utilities:
Cairo: ${have_cairo}
Fontconfig: ${have_fontconfig}
Additional shapers (the more the better):
Graphite2: ${have_graphite2}
Platform shapers (not normally needed):
CoreText: ${have_coretext}
Uniscribe: ${have_uniscribe}
DirectWrite: ${have_directwrite}
Other features:
Documentation: ${have_gtk_doc}
GObject bindings: ${have_gobject}
Introspection: ${have_introspection}
])

Просмотреть файл

@ -1,18 +1,25 @@
# git.mk
# git.mk, a small Makefile to autogenerate .gitignore files
# for autotools-based projects.
#
# Copyright 2009, Red Hat, Inc.
# Copyright 2010,2011,2012,2013 Behdad Esfahbod
# Written by Behdad Esfahbod
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# is permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# The canonical source for this file is pango/git.mk, or whereever the
# header of pango/git.mk suggests in the future.
# The latest version of this file can be downloaded from:
GIT_MK_URL = https://raw.githubusercontent.com/behdad/git.mk/master/git.mk
#
# Bugs, etc, should be reported upstream at:
# https://github.com/behdad/git.mk
#
# To use in your project, import this file in your git repo's toplevel,
# then do "make -f git.mk". This modifies all Makefile.am files in
# your project to include git.mk.
# your project to -include git.mk. Remember to add that line to new
# Makefile.am files you create in your project, or just rerun the
# "make -f git.mk".
#
# This enables automatic .gitignore generation. If you need to ignore
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
@ -22,7 +29,7 @@
#
# The only case that you need to manually add a file to GITIGNOREFILES is
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
# or maintainer-clean-local.
# or maintainer-clean-local make targets.
#
# Note that for files like editor backup, etc, there are better places to
# ignore them. See "man gitignore".
@ -30,18 +37,25 @@
# If "make maintainer-clean" removes the files but they are not recognized
# by this script (that is, if "git status" shows untracked files still), send
# me the output of "git status" as well as your Makefile.am and Makefile for
# the directories involved.
# the directories involved and I'll diagnose.
#
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
# pango/Makefile.am.
# Makefile.am.sample in the git.mk git repo.
#
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
# not tarballs. It serves no useful purpose in tarballs and clutters the
# build dir.
#
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
# gnome-doc-utils, intltool.
# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu, appdata,
# appstream.
#
# This makefile provides the following targets:
#
# - all: "make all" will build all gitignore files.
# - gitignore: makes all gitignore files in the current dir and subdirs.
# - .gitignore: make gitignore file for the current dir.
# - gitignore-recurse: makes all gitignore files in the subdirs.
#
# KNOWN ISSUES:
#
@ -53,13 +67,74 @@
# example.
#
###############################################################################
# Variables user modules may want to add to toplevel MAINTAINERCLEANFILES:
###############################################################################
#
# Most autotools-using modules should be fine including this variable in their
# toplevel MAINTAINERCLEANFILES:
GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL = \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/configure.scan \
`AUX_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_AUX_DIR:$$1' ./configure.ac); \
test "x$$AUX_DIR" = "x$(srcdir)/" && AUX_DIR=$(srcdir); \
for x in \
ar-lib \
compile \
config.guess \
config.sub \
depcomp \
install-sh \
ltmain.sh \
missing \
mkinstalldirs \
test-driver \
ylwrap \
; do echo "$$AUX_DIR/$$x"; done` \
`cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_HEADERS:$$1' ./configure.ac | \
head -n 1 | while read f; do echo "$(srcdir)/$$f.in"; done`
#
# All modules should also be fine including the following variable, which
# removes automake-generated Makefile.in files:
GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN = \
`cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_FILES:$$1' ./configure.ac | \
while read f; do \
case $$f in Makefile|*/Makefile) \
test -f "$(srcdir)/$$f.am" && echo "$(srcdir)/$$f.in";; esac; \
done`
#
# Modules that use libtool and use AC_CONFIG_MACRO_DIR() may also include this,
# though it's harmless to include regardless.
GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL = \
`MACRO_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_MACRO_DIR:$$1' ./configure.ac); \
if test "x$$MACRO_DIR" != "x$(srcdir)/"; then \
for x in \
libtool.m4 \
ltoptions.m4 \
ltsugar.m4 \
ltversion.m4 \
lt~obsolete.m4 \
; do echo "$$MACRO_DIR/$$x"; done; \
fi`
###############################################################################
# Default rule is to install ourselves in all Makefile.am files:
###############################################################################
git-all: git-mk-install
git-mk-install:
@echo Installing git makefile
@any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
@echo "Installing git makefile"
@any_failed=; \
find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \
if grep 'include .*/git.mk' $$x >/dev/null; then \
echo $$x already includes git.mk; \
echo "$$x already includes git.mk"; \
else \
failed=; \
echo "Updating $$x"; \
@ -71,55 +146,114 @@ git-mk-install:
mv $$x.tmp $$x || failed=1; \
fi; \
if test x$$failed = x; then : else \
echo Failed updating $$x; >&2 \
echo "Failed updating $$x"; >&2 \
any_failed=1; \
fi; \
fi; done; test -z "$$any_failed"
.PHONY: git-all git-mk-install
git-mk-update:
wget $(GIT_MK_URL) -O $(top_srcdir)/git.mk
.PHONY: git-all git-mk-install git-mk-update
### .gitignore generation
###############################################################################
# Actual .gitignore generation:
###############################################################################
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
$(AM_V_GEN) \
{ \
@echo "git.mk: Generating $@"
@{ \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
for x in \
$(DOC_MODULE)-decl-list.txt \
$(DOC_MODULE)-decl.txt \
tmpl/$(DOC_MODULE)-unused.sgml \
"tmpl/*.bak" \
$(REPORT_FILES) \
$(DOC_MODULE).pdf \
xml html \
; do echo /$$x; done; \
; do echo "/$$x"; done; \
FLAVOR=$$(cd $(top_srcdir); $(AUTOCONF) --trace 'GTK_DOC_CHECK:$$2' ./configure.ac); \
case $$FLAVOR in *no-tmpl*) echo /tmpl;; esac; \
if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-types"; then \
echo "/$(DOC_MODULE).types"; \
fi; \
if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-sections"; then \
echo "/$(DOC_MODULE)-sections.txt"; \
fi; \
if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
for x in \
$(SETUP_FILES) \
$(DOC_MODULE).types \
; do echo "/$$x"; done; \
fi; \
fi; \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
for lc in $(DOC_LINGUAS); do \
for x in \
$(if $(DOC_MODULE),$(DOC_MODULE).xml) \
$(DOC_PAGES) \
$(DOC_INCLUDES) \
; do echo "/$$lc/$$x"; done; \
done; \
for x in \
$(_DOC_C_DOCS) \
$(_DOC_LC_DOCS) \
$(_DOC_OMF_ALL) \
$(_DOC_DSK_ALL) \
$(_DOC_HTML_ALL) \
$(_DOC_POFILES) \
$(_DOC_MOFILES) \
$(DOC_H_FILE) \
"*/.xml2po.mo" \
"*/*.omf.out" \
; do echo /$$x; done; \
fi; \
if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \
for lc in $(HELP_LINGUAS); do \
for x in \
$(HELP_FILES) \
"$$lc.stamp" \
"$$lc.mo" \
; do echo "/$$lc/$$x"; done; \
done; \
fi; \
if test "x$(gsettings_SCHEMAS)" = x; then :; else \
for x in \
$(gsettings_SCHEMAS:.xml=.valid) \
$(gsettings__enum_file) \
; do echo "/$$x"; done; \
fi; \
if test "x$(appdata_XML)" = x; then :; else \
for x in \
$(appdata_XML:.xml=.valid) \
; do echo "/$$x"; done; \
fi; \
if test "x$(appstream_XML)" = x; then :; else \
for x in \
$(appstream_XML:.xml=.valid) \
; do echo "/$$x"; done; \
fi; \
if test -f $(srcdir)/po/Makefile.in.in; then \
for x in \
po/Makefile.in.in \
po/Makefile.in.in~ \
po/Makefile.in \
po/Makefile \
po/Makevars.template \
po/POTFILES \
po/Rules-quot \
po/stamp-it \
po/.intltool-merge-cache \
"po/*.gmo" \
"po/*.header" \
"po/*.mo" \
"po/*.sed" \
"po/*.sin" \
po/$(GETTEXT_PACKAGE).pot \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
; do echo /$$x; done; \
; do echo "/$$x"; done; \
fi; \
if test -f $(srcdir)/configure; then \
for x in \
@ -129,21 +263,38 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
stamp-h1 \
libtool \
config.lt \
; do echo /$$x; done; \
; do echo "/$$x"; done; \
fi; \
if test "x$(DEJATOOL)" = x; then :; else \
for x in \
$(DEJATOOL) \
; do echo "/$$x.sum"; echo "/$$x.log"; done; \
echo /site.exp; \
fi; \
if test "x$(am__dirstamp)" = x; then :; else \
echo "$(am__dirstamp)"; \
fi; \
if test "x$(LTCOMPILE)" = x -a "x$(LTCXXCOMPILE)" = x -a "x$(GTKDOC_RUN)" = x; then :; else \
for x in \
"*.lo" \
".libs" "_libs" \
; do echo "$$x"; done; \
fi; \
for x in \
.gitignore \
$(GITIGNOREFILES) \
$(CLEANFILES) \
$(PROGRAMS) \
$(check_PROGRAMS) \
$(EXTRA_PROGRAMS) \
$(LTLIBRARIES) \
$(PROGRAMS) $(check_PROGRAMS) $(EXTRA_PROGRAMS) \
$(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \
$(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \
so_locations \
.libs _libs \
$(MOSTLYCLEANFILES) \
"*.$(OBJEXT)" \
"*.lo" \
$(TEST_LOGS) \
$(TEST_LOGS:.log=.trs) \
$(TEST_SUITE_LOG) \
$(TESTS:=.test) \
"*.gcda" \
"*.gcno" \
$(DISTCLEANFILES) \
$(am__CONFIG_DISTCLEAN_FILES) \
$(CONFIG_CLEAN_FILES) \
@ -151,7 +302,10 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
"*.tab.c" \
$(MAINTAINERCLEANFILES) \
$(BUILT_SOURCES) \
$(DEPDIR) \
$(patsubst %.vala,%.c,$(filter %.vala,$(SOURCES))) \
$(filter %_vala.stamp,$(DIST_COMMON)) \
$(filter %.vapi,$(DIST_COMMON)) \
$(filter $(addprefix %,$(notdir $(patsubst %.vapi,%.h,$(filter %.vapi,$(DIST_COMMON))))),$(DIST_COMMON)) \
Makefile \
Makefile.in \
"*.orig" \
@ -159,7 +313,12 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
"*.bak" \
"*~" \
".*.sw[nop]" \
; do echo /$$x; done; \
".dirstamp" \
; do echo "/$$x"; done; \
for x in \
"*.$(OBJEXT)" \
$(DEPDIR) \
; do echo "$$x"; done; \
} | \
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
sed 's@/[.]/@/@g' | \
@ -167,16 +326,20 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
mv $@.tmp $@;
all: $(srcdir)/.gitignore gitignore-recurse-maybe
gitignore-recurse-maybe:
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
fi;
gitignore-recurse:
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
done
gitignore: $(srcdir)/.gitignore gitignore-recurse
gitignore-recurse-maybe:
@for subdir in $(DIST_SUBDIRS); do \
case " $(SUBDIRS) " in \
*" $$subdir "*) :;; \
*) test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir");; \
esac; \
done
gitignore-recurse:
@for subdir in $(DIST_SUBDIRS); do \
test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir"); \
done
maintainer-clean: gitignore-clean
gitignore-clean:
-rm -f $(srcdir)/.gitignore

Просмотреть файл

@ -0,0 +1,24 @@
<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns="http://usefulinc.com/ns/doap#">
<name xml:lang="en">harfbuzz</name>
<shortdesc xml:lang="en">Text shaping library</shortdesc>
<homepage
rdf:resource="http://harfbuzz.org/" />
<mailing-list
rdf:resource="http://lists.freedesktop.org/mailman/listinfo/harfbuzz" />
<!--download-page
rdf:resource=""/-->
<bug-database
rdf:resource="http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz"/>
<maintainer>
<foaf:Person>
<foaf:name>Behdad Esfahbod</foaf:name>
<foaf:mbox rdf:resource="mailto:harfbuzz@behdad.org" />
</foaf:Person>
</maintainer>
</Project>

Просмотреть файл

@ -1,11 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: harfbuzz
Description: Text shaping library
Version: @VERSION@
Libs: -L${libdir} -lharfbuzz
Cflags: -I${includedir}/harfbuzz

Просмотреть файл

@ -19,8 +19,8 @@ tested=false
for suffix in so dylib; do
so=.libs/libharfbuzz.$suffix
if ! test -f "$so"; then continue; fi
EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| _fbss\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>\| __gcov_flush\>\| llvm_' | cut -d' ' -f3`"
EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| _fbss\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>\| __gcov_flush\>\| ___gcov_flush\>\| llvm_\| _llvm_' | cut -d' ' -f3`"
prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'`

Просмотреть файл

@ -5,7 +5,7 @@ includedir=/usr/local/include
Name: harfbuzz
Description: HarfBuzz text shaping library ICU integration
Version: 1.0.1
Version: 1.3.3
Requires: harfbuzz
Requires.private: icu-uc

Просмотреть файл

@ -5,7 +5,9 @@ includedir=/usr/local/include
Name: harfbuzz
Description: HarfBuzz text shaping library
Version: 1.0.1
Version: 1.3.3
Libs: -L${libdir} -lharfbuzz
Libs.private:
Requires.private: glib-2.0 >= 2.38
Cflags: -I${includedir}/harfbuzz

Просмотреть файл

@ -149,9 +149,17 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
/* crbug.com/576941 and crbug.com/625902 and the investigation in the latter
* bug indicate that the cascade list reconfiguration occasionally causes
* crashes in CoreText on OS X 10.9, thus let's skip this step on older
* operating system versions. */
if (&CTGetCoreTextVersion != NULL && CTGetCoreTextVersion() <= kCTVersionNumber10_9)
return ct_font;
* operating system versions. Except for the emoji font, where _not_
* reconfiguring the cascade list causes CoreText crashes. For details, see
* crbug.com/549610 */
// 0x00070000 stands for "kCTVersionNumber10_10", see CoreText.h
if (&CTGetCoreTextVersion != NULL && CTGetCoreTextVersion() < 0x00070000) {
CFStringRef fontName = CTFontCopyPostScriptName (ct_font);
bool isEmojiFont = CFStringCompare (fontName, CFSTR("AppleColorEmoji"), 0) == kCFCompareEqualTo;
CFRelease (fontName);
if (!isEmojiFont)
return ct_font;
}
CFURLRef original_url = (CFURLRef)CTFontCopyAttribute(ct_font, kCTFontURLAttribute);

Просмотреть файл

@ -29,10 +29,6 @@
#include "hb-directwrite.h"
#include "hb-open-file-private.hh"
#include "hb-ot-name-table.hh"
#include "hb-ot-tag.h"
#ifndef HB_DEBUG_DIRECTWRITE
#define HB_DEBUG_DIRECTWRITE (HB_DEBUG+0)

Просмотреть файл

@ -116,8 +116,12 @@ struct hb_font_t {
/* Convert from font-space to user-space */
inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, this->x_scale); }
inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, this->y_scale); }
inline int dir_scale (hb_direction_t direction)
{ return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; }
inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); }
inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); }
inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction)
{ return em_scale (v, dir_scale (direction)); }
/* Convert from parent-font user-space to our user-space */
inline hb_position_t parent_scale_x_distance (hb_position_t v) {
@ -504,7 +508,6 @@ struct hb_font_t {
return false;
}
private:
inline hb_position_t em_scale (int16_t v, int scale)
{
int upem = face->get_upem ();

Просмотреть файл

@ -382,7 +382,6 @@ hb_glib_get_unicode_funcs (void)
return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
}
#if GLIB_CHECK_VERSION(2,31,10)
/**
* hb_glib_blob_create:
*
@ -399,4 +398,3 @@ hb_glib_blob_create (GBytes *gbytes)
g_bytes_ref (gbytes),
(hb_destroy_func_t) g_bytes_unref);
}
#endif

Просмотреть файл

@ -46,10 +46,9 @@ hb_glib_script_from_script (hb_script_t script);
HB_EXTERN hb_unicode_funcs_t *
hb_glib_get_unicode_funcs (void);
#if GLIB_CHECK_VERSION(2,31,10)
HB_EXTERN hb_blob_t *
hb_glib_blob_create (GBytes *gbytes);
#endif
HB_END_DECLS

Просмотреть файл

@ -78,3 +78,6 @@ HB_DEFINE_VALUE_TYPE (glyph_info)
HB_DEFINE_VALUE_TYPE (glyph_position)
HB_DEFINE_VALUE_TYPE (segment_properties)
HB_DEFINE_VALUE_TYPE (user_data_key)
HB_DEFINE_VALUE_TYPE (ot_math_glyph_variant)
HB_DEFINE_VALUE_TYPE (ot_math_glyph_part)

Просмотреть файл

@ -0,0 +1,722 @@
/*
* Copyright © 2016 Igalia S.L.
*
* 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.
*
* Igalia Author(s): Frédéric Wang
*/
#ifndef HB_OT_LAYOUT_MATH_TABLE_HH
#define HB_OT_LAYOUT_MATH_TABLE_HH
#include "hb-open-type-private.hh"
#include "hb-ot-layout-common-private.hh"
#include "hb-ot-math.h"
namespace OT {
struct MathValueRecord
{
inline hb_position_t get_x_value (hb_font_t *font, const void *base) const
{ return font->em_scale_x (value) + (base+deviceTable).get_x_delta (font); }
inline hb_position_t get_y_value (hb_font_t *font, const void *base) const
{ return font->em_scale_y (value) + (base+deviceTable).get_y_delta (font); }
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && deviceTable.sanitize (c, base));
}
protected:
SHORT value; /* The X or Y value in design units */
OffsetTo<Device> deviceTable; /* Offset to the device table - from the
* beginning of parent table. May be NULL.
* Suggested format for device table is 1. */
public:
DEFINE_SIZE_STATIC (4);
};
struct MathConstants
{
inline bool sanitize_math_value_records (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
unsigned int count = ARRAY_LENGTH (mathValueRecords);
for (unsigned int i = 0; i < count; i++)
if (!mathValueRecords[i].sanitize (c, this))
return_trace (false);
return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && sanitize_math_value_records(c));
}
inline hb_position_t get_value (hb_ot_math_constant_t constant,
hb_font_t *font) const
{
switch (constant) {
case HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN:
case HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN:
return percentScaleDown[constant - HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN];
case HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT:
case HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT:
return font->em_scale_y (minHeight[constant - HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT]);
case HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE:
case HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE:
case HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP:
case HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT:
return mathValueRecords[constant - HB_OT_MATH_CONSTANT_MATH_LEADING].get_x_value(font, this);
case HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT:
case HB_OT_MATH_CONSTANT_AXIS_HEIGHT:
case HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT:
case HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN:
case HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN:
case HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP:
case HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN:
case HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP:
case HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN:
case HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS:
case HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN:
case HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN:
case HB_OT_MATH_CONSTANT_MATH_LEADING:
case HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER:
case HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS:
case HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP:
case HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP:
case HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER:
case HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS:
case HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP:
case HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP:
case HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN:
case HB_OT_MATH_CONSTANT_STACK_GAP_MIN:
case HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP:
case HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP:
case HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN:
case HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN:
case HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP:
case HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN:
case HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN:
case HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX:
case HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN:
case HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX:
case HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT:
case HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN:
case HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP:
case HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED:
case HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER:
case HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS:
case HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP:
case HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN:
case HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN:
return mathValueRecords[constant - HB_OT_MATH_CONSTANT_MATH_LEADING].get_y_value(font, this);
case HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT:
return radicalDegreeBottomRaisePercent;
default:
return 0;
}
}
protected:
SHORT percentScaleDown[2];
USHORT minHeight[2];
MathValueRecord mathValueRecords[51];
SHORT radicalDegreeBottomRaisePercent;
public:
DEFINE_SIZE_STATIC (214);
};
struct MathItalicsCorrectionInfo
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
coverage.sanitize (c, this) &&
italicsCorrection.sanitize (c, this));
}
inline hb_position_t get_value (hb_codepoint_t glyph,
hb_font_t *font) const
{
unsigned int index = (this+coverage).get_coverage (glyph);
return italicsCorrection[index].get_x_value (font, this);
}
protected:
OffsetTo<Coverage> coverage; /* Offset to Coverage table -
* from the beginning of
* MathItalicsCorrectionInfo
* table. */
ArrayOf<MathValueRecord> italicsCorrection; /* Array of MathValueRecords
* defining italics correction
* values for each
* covered glyph. */
public:
DEFINE_SIZE_ARRAY (4, italicsCorrection);
};
struct MathTopAccentAttachment
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
topAccentCoverage.sanitize (c, this) &&
topAccentAttachment.sanitize (c, this));
}
inline hb_position_t get_value (hb_codepoint_t glyph,
hb_font_t *font) const
{
unsigned int index = (this+topAccentCoverage).get_coverage (glyph);
if (index == NOT_COVERED)
return font->get_glyph_h_advance (glyph) / 2;
return topAccentAttachment[index].get_x_value(font, this);
}
protected:
OffsetTo<Coverage> topAccentCoverage; /* Offset to Coverage table -
* from the beginning of
* MathTopAccentAttachment
* table. */
ArrayOf<MathValueRecord> topAccentAttachment; /* Array of MathValueRecords
* defining top accent
* attachment points for each
* covered glyph. */
public:
DEFINE_SIZE_ARRAY (2 + 2, topAccentAttachment);
};
struct MathKern
{
inline bool sanitize_math_value_records (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
unsigned int count = 2 * heightCount + 1;
for (unsigned int i = 0; i < count; i++)
if (!mathValueRecords[i].sanitize (c, this)) return_trace (false);
return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
c->check_array (mathValueRecords,
mathValueRecords[0].static_size,
2 * heightCount + 1) &&
sanitize_math_value_records (c));
}
inline hb_position_t get_value (hb_position_t correction_height, hb_font_t *font) const
{
const MathValueRecord* correctionHeight = mathValueRecords;
const MathValueRecord* kernValue = mathValueRecords + heightCount;
int sign = font->y_scale < 0 ? -1 : +1;
/* The description of the MathKern table is a ambiguous, but interpreting
* "between the two heights found at those indexes" for 0 < i < len as
*
* correctionHeight[i-1] < correction_height <= correctionHeight[i]
*
* makes the result consistent with the limit cases and we can just use the
* binary search algorithm of std::upper_bound:
*/
unsigned int i = 0;
unsigned int count = heightCount;
while (count > 0)
{
unsigned int half = count / 2;
hb_position_t height = correctionHeight[i + half].get_y_value(font, this);
if (sign * height < sign * correction_height)
{
i += half + 1;
count -= half + 1;
} else
count = half;
}
return kernValue[i].get_x_value(font, this);
}
protected:
USHORT heightCount;
MathValueRecord mathValueRecords[VAR]; /* Array of correction heights at
* which the kern value changes.
* Sorted by the height value in
* design units (heightCount entries),
* Followed by:
* Array of kern values corresponding
* to heights. (heightCount+1 entries).
*/
public:
DEFINE_SIZE_ARRAY (2, mathValueRecords);
};
struct MathKernInfoRecord
{
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
unsigned int count = ARRAY_LENGTH (mathKern);
for (unsigned int i = 0; i < count; i++)
if (unlikely (!mathKern[i].sanitize (c, base)))
return_trace (false);
return_trace (true);
}
inline hb_position_t get_kerning (hb_ot_math_kern_t kern,
hb_position_t correction_height,
hb_font_t *font,
const void *base) const
{
unsigned int idx = kern;
if (unlikely (idx >= ARRAY_LENGTH (mathKern))) return 0;
return (base+mathKern[idx]).get_value (correction_height, font);
}
protected:
/* Offset to MathKern table for each corner -
* from the beginning of MathKernInfo table. May be NULL. */
OffsetTo<MathKern> mathKern[4];
public:
DEFINE_SIZE_STATIC (8);
};
struct MathKernInfo
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
mathKernCoverage.sanitize (c, this) &&
mathKernInfoRecords.sanitize (c, this));
}
inline hb_position_t get_kerning (hb_codepoint_t glyph,
hb_ot_math_kern_t kern,
hb_position_t correction_height,
hb_font_t *font) const
{
unsigned int index = (this+mathKernCoverage).get_coverage (glyph);
return mathKernInfoRecords[index].get_kerning (kern, correction_height, font, this);
}
protected:
OffsetTo<Coverage> mathKernCoverage; /* Offset to Coverage table -
* from the beginning of the
* MathKernInfo table. */
ArrayOf<MathKernInfoRecord> mathKernInfoRecords; /* Array of
* MathKernInfoRecords,
* per-glyph information for
* mathematical positioning
* of subscripts and
* superscripts. */
public:
DEFINE_SIZE_ARRAY (4, mathKernInfoRecords);
};
struct MathGlyphInfo
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
mathItalicsCorrectionInfo.sanitize (c, this) &&
mathTopAccentAttachment.sanitize (c, this) &&
extendedShapeCoverage.sanitize (c, this) &&
mathKernInfo.sanitize(c, this));
}
inline hb_position_t
get_italics_correction (hb_codepoint_t glyph, hb_font_t *font) const
{ return (this+mathItalicsCorrectionInfo).get_value (glyph, font); }
inline hb_position_t
get_top_accent_attachment (hb_codepoint_t glyph, hb_font_t *font) const
{ return (this+mathTopAccentAttachment).get_value (glyph, font); }
inline bool is_extended_shape (hb_codepoint_t glyph) const
{ return (this+extendedShapeCoverage).get_coverage (glyph) != NOT_COVERED; }
inline hb_position_t get_kerning (hb_codepoint_t glyph,
hb_ot_math_kern_t kern,
hb_position_t correction_height,
hb_font_t *font) const
{ return (this+mathKernInfo).get_kerning (glyph, kern, correction_height, font); }
protected:
/* Offset to MathItalicsCorrectionInfo table -
* from the beginning of MathGlyphInfo table. */
OffsetTo<MathItalicsCorrectionInfo> mathItalicsCorrectionInfo;
/* Offset to MathTopAccentAttachment table -
* from the beginning of MathGlyphInfo table. */
OffsetTo<MathTopAccentAttachment> mathTopAccentAttachment;
/* Offset to coverage table for Extended Shape glyphs -
* from the beginning of MathGlyphInfo table. When the left or right glyph of
* a box is an extended shape variant, the (ink) box (and not the default
* position defined by values in MathConstants table) should be used for
* vertical positioning purposes. May be NULL.. */
OffsetTo<Coverage> extendedShapeCoverage;
/* Offset to MathKernInfo table -
* from the beginning of MathGlyphInfo table. */
OffsetTo<MathKernInfo> mathKernInfo;
public:
DEFINE_SIZE_STATIC (8);
};
struct MathGlyphVariantRecord
{
friend struct MathGlyphConstruction;
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this));
}
protected:
GlyphID variantGlyph; /* Glyph ID for the variant. */
USHORT advanceMeasurement; /* Advance width/height, in design units, of the
* variant, in the direction of requested
* glyph extension. */
public:
DEFINE_SIZE_STATIC (4);
};
struct PartFlags : USHORT
{
enum Flags {
Extender = 0x0001u, /* If set, the part can be skipped or repeated. */
Defined = 0x0001u, /* All defined flags. */
};
public:
DEFINE_SIZE_STATIC (2);
};
struct MathGlyphPartRecord
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this));
}
inline void extract (hb_ot_math_glyph_part_t &out,
int scale,
hb_font_t *font) const
{
out.glyph = glyph;
out.start_connector_length = font->em_scale (startConnectorLength, scale);
out.end_connector_length = font->em_scale (endConnectorLength, scale);
out.full_advance = font->em_scale (fullAdvance, scale);
ASSERT_STATIC ((unsigned int) HB_MATH_GLYPH_PART_FLAG_EXTENDER ==
(unsigned int) PartFlags::Extender);
out.flags = (hb_ot_math_glyph_part_flags_t)
(unsigned int)
(partFlags & PartFlags::Defined);
}
protected:
GlyphID glyph; /* Glyph ID for the part. */
USHORT startConnectorLength; /* Advance width/ height of the straight bar
* connector material, in design units, is at
* the beginning of the glyph, in the
* direction of the extension. */
USHORT endConnectorLength; /* Advance width/ height of the straight bar
* connector material, in design units, is at
* the end of the glyph, in the direction of
* the extension. */
USHORT fullAdvance; /* Full advance width/height for this part,
* in the direction of the extension.
* In design units. */
PartFlags partFlags; /* Part qualifiers. */
public:
DEFINE_SIZE_STATIC (10);
};
struct MathGlyphAssembly
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
italicsCorrection.sanitize(c, this) &&
partRecords.sanitize(c));
}
inline unsigned int get_parts (hb_direction_t direction,
hb_font_t *font,
unsigned int start_offset,
unsigned int *parts_count, /* IN/OUT */
hb_ot_math_glyph_part_t *parts /* OUT */,
hb_position_t *italics_correction /* OUT */) const
{
if (parts_count)
{
int scale = font->dir_scale (direction);
const MathGlyphPartRecord *arr =
partRecords.sub_array (start_offset, parts_count);
unsigned int count = *parts_count;
for (unsigned int i = 0; i < count; i++)
arr[i].extract (parts[i], scale, font);
}
if (italics_correction)
*italics_correction = italicsCorrection.get_x_value (font, this);
return partRecords.len;
}
protected:
MathValueRecord italicsCorrection; /* Italics correction of this
* MathGlyphAssembly. Should not
* depend on the assembly size. */
ArrayOf<MathGlyphPartRecord> partRecords; /* Array of part records, from
* left to right and bottom to
* top. */
public:
DEFINE_SIZE_ARRAY (6, partRecords);
};
struct MathGlyphConstruction
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
glyphAssembly.sanitize(c, this) &&
mathGlyphVariantRecord.sanitize(c));
}
inline const MathGlyphAssembly &get_assembly (void) const
{ return this+glyphAssembly; }
inline unsigned int get_variants (hb_direction_t direction,
hb_font_t *font,
unsigned int start_offset,
unsigned int *variants_count, /* IN/OUT */
hb_ot_math_glyph_variant_t *variants /* OUT */) const
{
if (variants_count)
{
int scale = font->dir_scale (direction);
const MathGlyphVariantRecord *arr =
mathGlyphVariantRecord.sub_array (start_offset, variants_count);
unsigned int count = *variants_count;
for (unsigned int i = 0; i < count; i++)
{
variants[i].glyph = arr[i].variantGlyph;
variants[i].advance = font->em_scale (arr[i].advanceMeasurement, scale);
}
}
return mathGlyphVariantRecord.len;
}
protected:
/* Offset to MathGlyphAssembly table for this shape - from the beginning of
MathGlyphConstruction table. May be NULL. */
OffsetTo<MathGlyphAssembly> glyphAssembly;
/* MathGlyphVariantRecords for alternative variants of the glyphs. */
ArrayOf<MathGlyphVariantRecord> mathGlyphVariantRecord;
public:
DEFINE_SIZE_ARRAY (4, mathGlyphVariantRecord);
};
struct MathVariants
{
inline bool sanitize_offsets (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
unsigned int count = vertGlyphCount + horizGlyphCount;
for (unsigned int i = 0; i < count; i++)
if (!glyphConstruction[i].sanitize (c, this)) return_trace (false);
return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
vertGlyphCoverage.sanitize (c, this) &&
horizGlyphCoverage.sanitize (c, this) &&
c->check_array (glyphConstruction,
glyphConstruction[0].static_size,
vertGlyphCount + horizGlyphCount) &&
sanitize_offsets (c));
}
inline hb_position_t get_min_connector_overlap (hb_direction_t direction,
hb_font_t *font) const
{ return font->em_scale_dir (minConnectorOverlap, direction); }
inline unsigned int get_glyph_variants (hb_codepoint_t glyph,
hb_direction_t direction,
hb_font_t *font,
unsigned int start_offset,
unsigned int *variants_count, /* IN/OUT */
hb_ot_math_glyph_variant_t *variants /* OUT */) const
{ return get_glyph_construction (glyph, direction, font)
.get_variants (direction, font, start_offset, variants_count, variants); }
inline unsigned int get_glyph_parts (hb_codepoint_t glyph,
hb_direction_t direction,
hb_font_t *font,
unsigned int start_offset,
unsigned int *parts_count, /* IN/OUT */
hb_ot_math_glyph_part_t *parts /* OUT */,
hb_position_t *italics_correction /* OUT */) const
{ return get_glyph_construction (glyph, direction, font)
.get_assembly ()
.get_parts (direction, font,
start_offset, parts_count, parts,
italics_correction); }
private:
inline const MathGlyphConstruction &
get_glyph_construction (hb_codepoint_t glyph,
hb_direction_t direction,
hb_font_t *font) const
{
bool vertical = HB_DIRECTION_IS_VERTICAL (direction);
unsigned int count = vertical ? vertGlyphCount : horizGlyphCount;
const OffsetTo<Coverage> &coverage = vertical ? vertGlyphCoverage
: horizGlyphCoverage;
unsigned int index = (this+coverage).get_coverage (glyph);
if (unlikely (index >= count)) return Null(MathGlyphConstruction);
if (!vertical)
index += vertGlyphCount;
return this+glyphConstruction[index];
}
protected:
USHORT minConnectorOverlap; /* Minimum overlap of connecting
* glyphs during glyph construction,
* in design units. */
OffsetTo<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
* from the beginning of MathVariants
* table. */
OffsetTo<Coverage> horizGlyphCoverage; /* Offset to Coverage table -
* from the beginning of MathVariants
* table. */
USHORT vertGlyphCount; /* Number of glyphs for which
* information is provided for
* vertically growing variants. */
USHORT horizGlyphCount; /* Number of glyphs for which
* information is provided for
* horizontally growing variants. */
/* Array of offsets to MathGlyphConstruction tables - from the beginning of
the MathVariants table, for shapes growing in vertical/horizontal
direction. */
OffsetTo<MathGlyphConstruction> glyphConstruction[VAR];
public:
DEFINE_SIZE_ARRAY (10, glyphConstruction);
};
/*
* MATH -- The MATH Table
*/
struct MATH
{
static const hb_tag_t tableTag = HB_OT_TAG_MATH;
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (version.sanitize (c) &&
likely (version.major == 1) &&
mathConstants.sanitize (c, this) &&
mathGlyphInfo.sanitize (c, this) &&
mathVariants.sanitize (c, this));
}
inline hb_position_t get_constant (hb_ot_math_constant_t constant,
hb_font_t *font) const
{ return (this+mathConstants).get_value (constant, font); }
inline const MathGlyphInfo &get_math_glyph_info (void) const
{ return this+mathGlyphInfo; }
inline const MathVariants &get_math_variants (void) const
{ return this+mathVariants; }
protected:
FixedVersion<>version; /* Version of the MATH table
* initially set to 0x00010000u */
OffsetTo<MathConstants> mathConstants;/* MathConstants table */
OffsetTo<MathGlyphInfo> mathGlyphInfo;/* MathGlyphInfo table */
OffsetTo<MathVariants> mathVariants; /* MathVariants table */
public:
DEFINE_SIZE_STATIC (10);
};
} /* mathspace OT */
#endif /* HB_OT_LAYOUT_MATH_TABLE_HH */

Просмотреть файл

@ -124,6 +124,7 @@ namespace OT {
struct GDEF;
struct GSUB;
struct GPOS;
struct MATH;
}
struct hb_ot_layout_lookup_accelerator_t
@ -152,10 +153,12 @@ struct hb_ot_layout_t
hb_blob_t *gdef_blob;
hb_blob_t *gsub_blob;
hb_blob_t *gpos_blob;
hb_blob_t *math_blob;
const struct OT::GDEF *gdef;
const struct OT::GSUB *gsub;
const struct OT::GPOS *gpos;
const struct OT::MATH *math;
unsigned int gsub_lookup_count;
unsigned int gpos_lookup_count;

Просмотреть файл

@ -35,6 +35,7 @@
#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-layout-gpos-table.hh"
#include "hb-ot-layout-jstf-table.hh"
#include "hb-ot-layout-math-table.hh"
#include "hb-ot-map-private.hh"
@ -60,6 +61,10 @@ _hb_ot_layout_create (hb_face_t *face)
layout->gpos_blob = OT::Sanitizer<OT::GPOS>::sanitize (face->reference_table (HB_OT_TAG_GPOS));
layout->gpos = OT::Sanitizer<OT::GPOS>::lock_instance (layout->gpos_blob);
/* The MATH table is rarely used, so only try and load it in _get_math. */
layout->math_blob = NULL;
layout->math = NULL;
{
/*
* The ugly business of blacklisting individual fonts' tables happen here!
@ -120,6 +125,14 @@ _hb_ot_layout_create (hb_face_t *face)
/* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
/* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
|| (188 == gdef_len && 3426 == gpos_len && 264 == gsub_len)
/* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
|| (1046 == gdef_len && 17112 == gpos_len && 71788 == gsub_len)
/* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
|| (1058 == gdef_len && 17514 == gpos_len && 71794 == gsub_len)
/* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
|| (1330 == gdef_len && 57938 == gpos_len && 109904 == gsub_len)
/* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
|| (1330 == gdef_len && 58972 == gpos_len && 109904 == gsub_len)
)
{
/* Many versions of Tahoma have bad GDEF tables that incorrectly classify some spacing marks
@ -169,6 +182,7 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout)
hb_blob_destroy (layout->gdef_blob);
hb_blob_destroy (layout->gsub_blob);
hb_blob_destroy (layout->gpos_blob);
hb_blob_destroy (layout->math_blob);
free (layout);
}
@ -191,6 +205,30 @@ _get_gpos (hb_face_t *face)
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::GPOS);
return *hb_ot_layout_from_face (face)->gpos;
}
static inline const OT::MATH&
_get_math (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::MATH);
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
retry:
const OT::MATH *math = (const OT::MATH *) hb_atomic_ptr_get (&layout->math);
if (unlikely (!math))
{
hb_blob_t *blob = OT::Sanitizer<OT::MATH>::sanitize (face->reference_table (HB_OT_TAG_MATH));
math = OT::Sanitizer<OT::MATH>::lock_instance (blob);
if (!hb_atomic_ptr_cmpexch (&layout->math, NULL, math))
{
hb_blob_destroy (blob);
goto retry;
}
layout->math_blob = blob;
}
return *math;
}
/*
@ -1182,3 +1220,221 @@ hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c,
{
apply_string<GSUBProxy> (c, lookup, accel);
}
/*
* MATH
*/
/* TODO Move this to hb-ot-math.cc and separate it from hb_ot_layout_t. */
/**
* hb_ot_math_has_data:
* @face: #hb_face_t to test
*
* This function allows to verify the presence of an OpenType MATH table on the
* face. If so, such a table will be loaded into memory and sanitized. You can
* then safely call other functions for math layout and shaping.
*
* Return value: #TRUE if face has a MATH table and #FALSE otherwise
*
* Since: 1.3.3
**/
hb_bool_t
hb_ot_math_has_data (hb_face_t *face)
{
return &_get_math (face) != &OT::Null(OT::MATH);
}
/**
* hb_ot_math_get_constant:
* @font: #hb_font_t from which to retrieve the value
* @constant: #hb_ot_math_constant_t the constant to retrieve
*
* This function returns the requested math constants as a #hb_position_t.
* If the request constant is HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN,
* HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN or
* HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN then the return value is
* actually an integer between 0 and 100 representing that percentage.
*
* Return value: the requested constant or 0
*
* Since: 1.3.3
**/
hb_position_t
hb_ot_math_get_constant (hb_font_t *font,
hb_ot_math_constant_t constant)
{
const OT::MATH &math = _get_math (font->face);
return math.get_constant(constant, font);
}
/**
* hb_ot_math_get_glyph_italics_correction:
* @font: #hb_font_t from which to retrieve the value
* @glyph: glyph index from which to retrieve the value
*
* Return value: the italics correction of the glyph or 0
*
* Since: 1.3.3
**/
hb_position_t
hb_ot_math_get_glyph_italics_correction (hb_font_t *font,
hb_codepoint_t glyph)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_glyph_info().get_italics_correction (glyph, font);
}
/**
* hb_ot_math_get_glyph_top_accent_attachment:
* @font: #hb_font_t from which to retrieve the value
* @glyph: glyph index from which to retrieve the value
*
* Return value: the top accent attachment of the glyph or 0
*
* Since: 1.3.3
**/
hb_position_t
hb_ot_math_get_glyph_top_accent_attachment (hb_font_t *font,
hb_codepoint_t glyph)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_glyph_info().get_top_accent_attachment (glyph, font);
}
/**
* hb_ot_math_is_glyph_extended_shape:
* @font: a #hb_font_t to test
* @glyph: a glyph index to test
*
* Return value: #TRUE if the glyph is an extended shape and #FALSE otherwise
*
* Since: 1.3.3
**/
hb_bool_t
hb_ot_math_is_glyph_extended_shape (hb_face_t *face,
hb_codepoint_t glyph)
{
const OT::MATH &math = _get_math (face);
return math.get_math_glyph_info().is_extended_shape (glyph);
}
/**
* hb_ot_math_get_glyph_kerning:
* @font: #hb_font_t from which to retrieve the value
* @glyph: glyph index from which to retrieve the value
* @kern: the #hb_ot_math_kern_t from which to retrieve the value
* @correction_height: the correction height to use to determine the kerning.
*
* This function tries to retrieve the MathKern table for the specified font,
* glyph and #hb_ot_math_kern_t. Then it browses the list of heights from the
* MathKern table to find one value that is greater or equal to specified
* correction_height. If one is found the corresponding value from the list of
* kerns is returned and otherwise the last kern value is returned.
*
* Return value: requested kerning or 0
*
* Since: 1.3.3
**/
hb_position_t
hb_ot_math_get_glyph_kerning (hb_font_t *font,
hb_codepoint_t glyph,
hb_ot_math_kern_t kern,
hb_position_t correction_height)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_glyph_info().get_kerning (glyph, kern, correction_height, font);
}
/**
* hb_ot_math_get_glyph_variants:
* @font: #hb_font_t from which to retrieve the values
* @glyph: index of the glyph to stretch
* @direction: direction of the stretching
* @start_offset: offset of the first variant to retrieve
* @variants_count: maximum number of variants to retrieve after start_offset
* (IN) and actual number of variants retrieved (OUT)
* @variants: array of size at least @variants_count to store the result
*
* This function tries to retrieve the MathGlyphConstruction for the specified
* font, glyph and direction. Note that only the value of
* #HB_DIRECTION_IS_HORIZONTAL is considered. It provides the corresponding list
* of size variants as an array of hb_ot_math_glyph_variant_t structs.
*
* Return value: the total number of size variants available or 0
*
* Since: 1.3.3
**/
unsigned int
hb_ot_math_get_glyph_variants (hb_font_t *font,
hb_codepoint_t glyph,
hb_direction_t direction,
unsigned int start_offset,
unsigned int *variants_count, /* IN/OUT */
hb_ot_math_glyph_variant_t *variants /* OUT */)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_variants().get_glyph_variants (glyph, direction, font,
start_offset,
variants_count,
variants);
}
/**
* hb_ot_math_get_min_connector_overlap:
* @font: #hb_font_t from which to retrieve the value
* @direction: direction of the stretching
*
* This function tries to retrieve the MathVariants table for the specified
* font and returns the minimum overlap of connecting glyphs to draw a glyph
* assembly in the specified direction. Note that only the value of
* #HB_DIRECTION_IS_HORIZONTAL is considered.
*
* Return value: requested min connector overlap or 0
*
* Since: 1.3.3
**/
hb_position_t
hb_ot_math_get_min_connector_overlap (hb_font_t *font,
hb_direction_t direction)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_variants().get_min_connector_overlap (direction, font);
}
/**
* hb_ot_math_get_glyph_assembly:
* @font: #hb_font_t from which to retrieve the values
* @glyph: index of the glyph to stretch
* @direction: direction of the stretching
* @start_offset: offset of the first glyph part to retrieve
* @parts_count: maximum number of glyph parts to retrieve after start_offset
* (IN) and actual number of parts retrieved (OUT)
* @parts: array of size at least @parts_count to store the result
* @italics_correction: italic correction of the glyph assembly
*
* This function tries to retrieve the GlyphAssembly for the specified font,
* glyph and direction. Note that only the value of #HB_DIRECTION_IS_HORIZONTAL
* is considered. It provides the information necessary to draw the glyph
* assembly as an array of #hb_ot_math_glyph_part_t.
*
* Return value: the total number of parts in the glyph assembly
*
* Since: 1.3.3
**/
unsigned int
hb_ot_math_get_glyph_assembly (hb_font_t *font,
hb_codepoint_t glyph,
hb_direction_t direction,
unsigned int start_offset,
unsigned int *parts_count, /* IN/OUT */
hb_ot_math_glyph_part_t *parts, /* OUT */
hb_position_t *italics_correction /* OUT */)
{
const OT::MATH &math = _get_math (font->face);
return math.get_math_variants().get_glyph_parts (glyph, direction, font,
start_offset,
parts_count,
parts,
italics_correction);
}

Просмотреть файл

@ -0,0 +1,209 @@
/*
* Copyright © 2016 Igalia S.L.
*
* 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.
*
* Igalia Author(s): Frédéric Wang
*/
#ifndef HB_OT_H_IN
#error "Include <hb-ot.h> instead."
#endif
#ifndef HB_OT_MATH_H
#define HB_OT_MATH_H
#include "hb.h"
HB_BEGIN_DECLS
/*
* MATH
*/
#define HB_OT_TAG_MATH HB_TAG('M','A','T','H')
/* Use with hb_buffer_set_script() for math shaping. */
#define HB_OT_MATH_SCRIPT HB_TAG('m','a','t','h')
/* Types */
/**
* hb_ot_math_constant_t:
*
* Since: 1.3.3
*/
typedef enum {
HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN = 0,
HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN = 1,
HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT = 2,
HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT = 3,
HB_OT_MATH_CONSTANT_MATH_LEADING = 4,
HB_OT_MATH_CONSTANT_AXIS_HEIGHT = 5,
HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT = 6,
HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT = 7,
HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN = 8,
HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX = 9,
HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN = 10,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP = 11,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED = 12,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN = 13,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX = 14,
HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN = 15,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT = 16,
HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT = 17,
HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN = 18,
HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN = 19,
HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN = 20,
HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN = 21,
HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP = 22,
HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP = 23,
HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN = 24,
HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN = 25,
HB_OT_MATH_CONSTANT_STACK_GAP_MIN = 26,
HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN = 27,
HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP = 28,
HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN = 29,
HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN = 30,
HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN = 31,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP = 32,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP = 33,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN = 34,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN = 35,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN = 36,
HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN = 37,
HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS = 38,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN = 39,
HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN = 40,
HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP = 41,
HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP = 42,
HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP = 43,
HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS = 44,
HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER = 45,
HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP = 46,
HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS = 47,
HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER = 48,
HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP = 49,
HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP = 50,
HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS = 51,
HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER = 52,
HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE = 53,
HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE = 54,
HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT = 55
} hb_ot_math_constant_t;
/**
* hb_ot_math_kern_t:
*
* Since: 1.3.3
*/
typedef enum {
HB_OT_MATH_KERN_TOP_RIGHT = 0,
HB_OT_MATH_KERN_TOP_LEFT = 1,
HB_OT_MATH_KERN_BOTTOM_RIGHT = 2,
HB_OT_MATH_KERN_BOTTOM_LEFT = 3
} hb_ot_math_kern_t;
/**
* hb_ot_math_glyph_variant_t:
*
* Since: 1.3.3
*/
typedef struct hb_ot_math_glyph_variant_t {
hb_codepoint_t glyph;
hb_position_t advance;
} hb_ot_math_glyph_variant_t;
/**
* hb_ot_math_glyph_part_flags_t:
*
* Since: 1.3.3
*/
typedef enum { /*< flags >*/
HB_MATH_GLYPH_PART_FLAG_EXTENDER = 0x00000001u /* Extender glyph */
} hb_ot_math_glyph_part_flags_t;
/**
* hb_ot_math_glyph_part_t:
*
* Since: 1.3.3
*/
typedef struct hb_ot_math_glyph_part_t {
hb_codepoint_t glyph;
hb_position_t start_connector_length;
hb_position_t end_connector_length;
hb_position_t full_advance;
hb_ot_math_glyph_part_flags_t flags;
} hb_ot_math_glyph_part_t;
/* Methods */
HB_EXTERN hb_bool_t
hb_ot_math_has_data (hb_face_t *face);
HB_EXTERN hb_position_t
hb_ot_math_get_constant (hb_font_t *font,
hb_ot_math_constant_t constant);
HB_EXTERN hb_position_t
hb_ot_math_get_glyph_italics_correction (hb_font_t *font,
hb_codepoint_t glyph);
HB_EXTERN hb_position_t
hb_ot_math_get_glyph_top_accent_attachment (hb_font_t *font,
hb_codepoint_t glyph);
HB_EXTERN hb_bool_t
hb_ot_math_is_glyph_extended_shape (hb_face_t *face,
hb_codepoint_t glyph);
HB_EXTERN hb_position_t
hb_ot_math_get_glyph_kerning (hb_font_t *font,
hb_codepoint_t glyph,
hb_ot_math_kern_t kern,
hb_position_t correction_height);
HB_EXTERN unsigned int
hb_ot_math_get_glyph_variants (hb_font_t *font,
hb_codepoint_t glyph,
hb_direction_t direction,
unsigned int start_offset,
unsigned int *variants_count, /* IN/OUT */
hb_ot_math_glyph_variant_t *variants /* OUT */);
HB_EXTERN hb_position_t
hb_ot_math_get_min_connector_overlap (hb_font_t *font,
hb_direction_t direction);
HB_EXTERN unsigned int
hb_ot_math_get_glyph_assembly (hb_font_t *font,
hb_codepoint_t glyph,
hb_direction_t direction,
unsigned int start_offset,
unsigned int *parts_count, /* IN/OUT */
hb_ot_math_glyph_part_t *parts, /* OUT */
hb_position_t *italics_correction /* OUT */);
HB_END_DECLS
#endif /* HB_OT_MATH_H */

Просмотреть файл

@ -32,6 +32,7 @@
#include "hb-ot-font.h"
#include "hb-ot-layout.h"
#include "hb-ot-math.h"
#include "hb-ot-tag.h"
#include "hb-ot-shape.h"

Просмотреть файл

@ -289,9 +289,10 @@ hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
unsigned int num_features)
{
DEBUG_MSG_FUNC (SHAPE_PLAN, shape_plan,
"num_features=%d shaper_func=%p",
"num_features=%d shaper_func=%p, shaper_name=%s",
num_features,
shape_plan->shaper_func);
shape_plan->shaper_func,
shape_plan->shaper_name);
if (unlikely (!buffer->len))
return true;

Просмотреть файл

@ -38,9 +38,9 @@ HB_BEGIN_DECLS
#define HB_VERSION_MAJOR 1
#define HB_VERSION_MINOR 3
#define HB_VERSION_MICRO 0
#define HB_VERSION_MICRO 3
#define HB_VERSION_STRING "1.3.0"
#define HB_VERSION_STRING "1.3.3"
#define HB_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \

Просмотреть файл

@ -13,6 +13,7 @@ EXPORTS.harfbuzz += [
'hb-font.h',
'hb-ot-font.h',
'hb-ot-layout.h',
'hb-ot-math.h',
'hb-ot-shape.h',
'hb-ot-tag.h',
'hb-ot.h',

Просмотреть файл

@ -4,7 +4,7 @@ load('CharsetConversionTests.js');
const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\ufffd\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\ufffd\ufffd\u200e\u200f\ufffd";
const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05ba\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\ufffd\ufffd\u200e\u200f\ufffd";
const aliases = [ "windows-1255", "x-cp1255", "cp1255" ];

Просмотреть файл

@ -2,9 +2,9 @@
load('CharsetConversionTests.js');
const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u200e\u200f";
const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05ba\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u200e\u200f";
const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfd\xfe";
const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfd\xfe";
const aliases = [ "windows-1255", "x-cp1255", "cp1255" ];

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -36,25 +36,18 @@ End of Item 0002
Begin of Item 0003
Format 0
srcBegin = 05B0
srcEnd = 05B9
srcEnd = 05C3
destBegin = 00C0
End of Item 0003
Begin of Item 0004
Format 0
srcBegin = 05BB
srcEnd = 05C3
destBegin = 00CB
End of Item 0004
Begin of Item 0005
Format 0
srcBegin = 05D0
srcEnd = 05EA
destBegin = 00E0
End of Item 0005
End of Item 0004
Begin of Item 0006
Begin of Item 0005
Format 1
srcBegin = 0081
srcEnd = 00A9
@ -66,57 +59,57 @@ Begin of Item 0006
FFFD 009A FFFD FFFD FFFD FFFD FFFD FFFD
FFFD FFFD FFFD FFFD 00A5 00A6 00A7 00A8
00A9
End of Item 0006
End of Item 0005
Begin of Item 0007
Begin of Item 0006
Format 1
srcBegin = 00BB
srcEnd = 00BF
mappingOffset = 0029
Mapping =
00BB 00BC 00BD 00BE 00BF
End of Item 0006
Begin of Item 0007
Format 2
srcBegin = 00D7
destBegin = 00AA
End of Item 0007
Begin of Item 0008
Format 2
srcBegin = 00D7
destBegin = 00AA
srcBegin = 00F7
destBegin = 00BA
End of Item 0008
Begin of Item 0009
Format 2
srcBegin = 00F7
destBegin = 00BA
srcBegin = 0192
destBegin = 0083
End of Item 0009
Begin of Item 000A
Format 2
srcBegin = 0192
destBegin = 0083
srcBegin = 02C6
destBegin = 0088
End of Item 000A
Begin of Item 000B
Format 2
srcBegin = 02C6
destBegin = 0088
srcBegin = 02DC
destBegin = 0098
End of Item 000B
Begin of Item 000C
Format 2
srcBegin = 02DC
destBegin = 0098
End of Item 000C
Begin of Item 000D
Format 1
srcBegin = 05F0
srcEnd = 05F4
mappingOffset = 002E
Mapping =
00D4 00D5 00D6 00D7 00D8
End of Item 000D
End of Item 000C
Begin of Item 000E
Begin of Item 000D
Format 1
srcBegin = 200E
srcEnd = 203A
@ -128,26 +121,26 @@ Begin of Item 000E
0085 FFFD FFFD FFFD FFFD FFFD FFFD FFFD
FFFD FFFD 0089 FFFD FFFD FFFD FFFD FFFD
FFFD FFFD FFFD 008B 009B
End of Item 000E
End of Item 000D
Begin of Item 000F
Begin of Item 000E
Format 1
srcBegin = 20AA
srcEnd = 20AC
mappingOffset = 0060
Mapping =
00A4 FFFD 0080
End of Item 000F
End of Item 000E
Begin of Item 0010
Begin of Item 000F
Format 2
srcBegin = 2122
destBegin = 0099
End of Item 0010
End of Item 000F
========================================================*/
/* Offset=0x0000 ItemOfList */
0x0011,
0x0010,
/*-------------------------------------------------------*/
/* Offset=0x0001 offsetToFormatArray */
0x0004,
@ -156,36 +149,35 @@ End of Item 0010
0x0009,
/*-------------------------------------------------------*/
/* Offset=0x0003 offsetToMappingTable */
0x003C,
0x0039,
/*-------------------------------------------------------*/
/* Offset=0x0004 Start of Format Array */
/* Total of Format 0 : 0x0006 */
/* Total of Format 0 : 0x0005 */
/* Total of Format 1 : 0x0005 */
/* Total of Format 2 : 0x0006 */
/* Total of Format 3 : 0x0000 */
0x0000, 0x1100, 0x2222, 0x1112, 0x0002,
0x0000, 0x2110, 0x2222, 0x2111, 0x0000,
/*-------------------------------------------------------*/
/* Offset=0x0009 Start of MapCell Array */
/* 0000 */ 0x0000, 0x007F, 0x0000,
/* 0001 */ 0x009C, 0x00A3, 0x009C,
/* 0002 */ 0x00AB, 0x00B9, 0x00AB,
/* 0003 */ 0x05B0, 0x05B9, 0x00C0,
/* 0004 */ 0x05BB, 0x05C3, 0x00CB,
/* 0005 */ 0x05D0, 0x05EA, 0x00E0,
/* 0006 */ 0x0081, 0x00A9, 0x0000,
/* 0007 */ 0x00BB, 0x00BF, 0x0029,
/* 0008 */ 0x00D7, 0x0000, 0x00AA,
/* 0009 */ 0x00F7, 0x0000, 0x00BA,
/* 000A */ 0x0192, 0x0000, 0x0083,
/* 000B */ 0x02C6, 0x0000, 0x0088,
/* 000C */ 0x02DC, 0x0000, 0x0098,
/* 000D */ 0x05F0, 0x05F4, 0x002E,
/* 000E */ 0x200E, 0x203A, 0x0033,
/* 000F */ 0x20AA, 0x20AC, 0x0060,
/* 0010 */ 0x2122, 0x0000, 0x0099,
/* 0003 */ 0x05B0, 0x05C3, 0x00C0,
/* 0004 */ 0x05D0, 0x05EA, 0x00E0,
/* 0005 */ 0x0081, 0x00A9, 0x0000,
/* 0006 */ 0x00BB, 0x00BF, 0x0029,
/* 0007 */ 0x00D7, 0x0000, 0x00AA,
/* 0008 */ 0x00F7, 0x0000, 0x00BA,
/* 0009 */ 0x0192, 0x0000, 0x0083,
/* 000A */ 0x02C6, 0x0000, 0x0088,
/* 000B */ 0x02DC, 0x0000, 0x0098,
/* 000C */ 0x05F0, 0x05F4, 0x002E,
/* 000D */ 0x200E, 0x203A, 0x0033,
/* 000E */ 0x20AA, 0x20AC, 0x0060,
/* 000F */ 0x2122, 0x0000, 0x0099,
/*-------------------------------------------------------*/
/* Offset=0x003C Start of MappingTable */
/* Offset=0x0039 Start of MappingTable */
/* 0000 */ 0x0081, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
/* 0008 */ 0xFFFD, 0x008A, 0xFFFD, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090,
@ -200,4 +192,4 @@ End of Item 0010
/* 0050 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD,
/* 0058 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B,
/* 0060 */ 0x00A4, 0xFFFD, 0x0080,
/* End of table Total Length = 0x009F * 2 */
/* End of table Total Length = 0x009C * 2 */

Просмотреть файл

@ -36,25 +36,18 @@ End of Item 0002
Begin of Item 0003
Format 0
srcBegin = 00C0
srcEnd = 00C9
srcEnd = 00D3
destBegin = 05B0
End of Item 0003
Begin of Item 0004
Format 0
srcBegin = 00CB
srcEnd = 00D3
destBegin = 05BB
End of Item 0004
Begin of Item 0005
Format 0
srcBegin = 00E0
srcEnd = 00FA
destBegin = 05D0
End of Item 0005
End of Item 0004
Begin of Item 0006
Begin of Item 0005
Format 1
srcBegin = 0080
srcEnd = 00AA
@ -66,38 +59,38 @@ Begin of Item 0006
02DC 2122 009A 203A FFFD FFFD FFFD FFFD
FFFD FFFD FFFD FFFD 20AA 00A5 00A6 00A7
00A8 00A9 00D7
End of Item 0006
End of Item 0005
Begin of Item 0007
Begin of Item 0006
Format 1
srcBegin = 00BA
srcEnd = 00BF
mappingOffset = 002B
Mapping =
00F7 00BB 00BC 00BD 00BE 00BF
End of Item 0007
End of Item 0006
Begin of Item 0008
Begin of Item 0007
Format 1
srcBegin = 00D4
srcEnd = 00D8
mappingOffset = 0031
Mapping =
05F0 05F1 05F2 05F3 05F4
End of Item 0008
End of Item 0007
Begin of Item 0009
Begin of Item 0008
Format 1
srcBegin = 00FD
srcEnd = 00FE
mappingOffset = 0036
Mapping =
200E 200F
End of Item 0009
End of Item 0008
========================================================*/
/* Offset=0x0000 ItemOfList */
0x000A,
0x0009,
/*-------------------------------------------------------*/
/* Offset=0x0001 offsetToFormatArray */
0x0004,
@ -106,29 +99,28 @@ End of Item 0009
0x0007,
/*-------------------------------------------------------*/
/* Offset=0x0003 offsetToMappingTable */
0x0025,
0x0022,
/*-------------------------------------------------------*/
/* Offset=0x0004 Start of Format Array */
/* Total of Format 0 : 0x0006 */
/* Total of Format 0 : 0x0005 */
/* Total of Format 1 : 0x0004 */
/* Total of Format 2 : 0x0000 */
/* Total of Format 3 : 0x0000 */
0x0000, 0x1100, 0x0011,
0x0000, 0x1110, 0x0001,
/*-------------------------------------------------------*/
/* Offset=0x0007 Start of MapCell Array */
/* 0000 */ 0x0000, 0x007F, 0x0000,
/* 0001 */ 0x009C, 0x00A3, 0x009C,
/* 0002 */ 0x00AB, 0x00B9, 0x00AB,
/* 0003 */ 0x00C0, 0x00C9, 0x05B0,
/* 0004 */ 0x00CB, 0x00D3, 0x05BB,
/* 0005 */ 0x00E0, 0x00FA, 0x05D0,
/* 0006 */ 0x0080, 0x00AA, 0x0000,
/* 0007 */ 0x00BA, 0x00BF, 0x002B,
/* 0008 */ 0x00D4, 0x00D8, 0x0031,
/* 0009 */ 0x00FD, 0x00FE, 0x0036,
/* 0003 */ 0x00C0, 0x00D3, 0x05B0,
/* 0004 */ 0x00E0, 0x00FA, 0x05D0,
/* 0005 */ 0x0080, 0x00AA, 0x0000,
/* 0006 */ 0x00BA, 0x00BF, 0x002B,
/* 0007 */ 0x00D4, 0x00D8, 0x0031,
/* 0008 */ 0x00FD, 0x00FE, 0x0036,
/*-------------------------------------------------------*/
/* Offset=0x0025 Start of MappingTable */
/* Offset=0x0022 Start of MappingTable */
/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
/* 0008 */ 0x02C6, 0x2030, 0x008A, 0x2039, 0x008C, 0x008D, 0x008E, 0x008F,
@ -137,4 +129,4 @@ End of Item 0009
/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
/* 0028 */ 0x00A8, 0x00A9, 0x00D7, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE,
/* 0030 */ 0x00BF, 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x200E, 0x200F,
/* End of table Total Length = 0x005D * 2 */
/* End of table Total Length = 0x005A * 2 */

Просмотреть файл

@ -332,7 +332,9 @@ class MOZ_NON_PARAM alignas(8) Value
}
void setDoubleNoCheck(double d) {
data.asDouble = d;
// Don't assign to data.asDouble to fix a miscompilation with
// GCC 5.2.1 and 5.3.1. See bug 1312488.
data = layout(d);
}
void setNaN() {

Просмотреть файл

@ -203,6 +203,9 @@ function ArraySort(comparefn) {
/* Step 2. */
var len = ToLength(O.length);
if (len <= 1)
return this;
/* 22.1.3.25.1 Runtime Semantics: SortCompare( x, y ) */
var wrappedCompareFn = comparefn;
comparefn = function(x, y) {

Просмотреть файл

@ -1071,7 +1071,8 @@ function TypedArraySome(callbackfn/*, thisArg*/) {
return false;
}
// ES6 draft 20151210 22.2.3.26
// ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e
// 22.2.3.26 TypedArray SortCompare abstract operation
// Cases are ordered according to likelihood of occurrence
// as opposed to the ordering in the spec.
function TypedArrayCompare(x, y) {
@ -1079,25 +1080,47 @@ function TypedArrayCompare(x, y) {
assert(typeof x === "number" && typeof y === "number",
"x and y are not numbers.");
// Steps 6 - 7.
// Step 2 (Implemented in TypedArraySort).
// Step 6.
if (x < y)
return -1;
// Step 7.
if (x > y)
return 1;
// Steps 8-9.
if (x === 0 && y === 0)
return (1/x > 0 ? 1 : 0) - (1/y > 0 ? 1 : 0);
// Steps 3-4.
if (Number_isNaN(x))
return Number_isNaN(y) ? 0 : 1;
// Steps 5, 10.
return Number_isNaN(y) ? -1 : 0;
}
// TypedArray SortCompare specialization for integer values.
function TypedArrayCompareInt(x, y) {
// Step 1.
assert(typeof x === "number" && typeof y === "number",
"x and y are not numbers.");
assert((x === (x|0) || x === (x>>>0)) && (y === (y|0) || y === (y>>>0)),
"x and y are not int32/uint32 numbers.");
// Step 2 (Implemented in TypedArraySort).
// Steps 6-7.
var diff = x - y;
if (diff)
return diff;
// Steps 8 - 10.
if (x === 0 && y === 0)
return (1/x > 0 ? 1 : 0) - (1/y > 0 ? 1 : 0);
// Step 2. Implemented in TypedArraySort
// Step 3.
if (Number_isNaN(x) && Number_isNaN(y))
return 0;
// Steps 4 - 5.
if (Number_isNaN(x) || Number_isNaN(y))
return Number_isNaN(x) ? 1 : -1;
// Steps 3-5, 8-9 (Not applicable when sorting integer values).
// Step 10.
return 0;
}
// ES6 draft 20151210 22.2.3.26 %TypedArray%.prototype.sort ( comparefn ).
@ -1132,13 +1155,13 @@ function TypedArraySort(comparefn) {
} else if (IsInt8TypedArray(obj)) {
return CountingSort(obj, len, true /* signed */);
} else if (IsUint16TypedArray(obj)) {
return RadixSort(obj, len, buffer, 2 /* nbytes */, false /* signed */, false /* floating */, TypedArrayCompare);
return RadixSort(obj, len, buffer, 2 /* nbytes */, false /* signed */, false /* floating */, TypedArrayCompareInt);
} else if (IsInt16TypedArray(obj)) {
return RadixSort(obj, len, buffer, 2 /* nbytes */, true /* signed */, false /* floating */, TypedArrayCompare);
return RadixSort(obj, len, buffer, 2 /* nbytes */, true /* signed */, false /* floating */, TypedArrayCompareInt);
} else if (IsUint32TypedArray(obj)) {
return RadixSort(obj, len, buffer, 4 /* nbytes */, false /* signed */, false /* floating */, TypedArrayCompare);
return RadixSort(obj, len, buffer, 4 /* nbytes */, false /* signed */, false /* floating */, TypedArrayCompareInt);
} else if (IsInt32TypedArray(obj)) {
return RadixSort(obj, len, buffer, 4 /* nbytes */, true /* signed */, false /* floating */, TypedArrayCompare);
return RadixSort(obj, len, buffer, 4 /* nbytes */, true /* signed */, false /* floating */, TypedArrayCompareInt);
} else if (IsFloat32TypedArray(obj)) {
return RadixSort(obj, len, buffer, 4 /* nbytes */, true /* signed */, true /* floating */, TypedArrayCompare);
}

Просмотреть файл

@ -1478,11 +1478,9 @@ TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier)
goto out;
case '*':
#ifdef JS_HAS_EXPONENTIATION
if (matchChar('*'))
tp->type = matchChar('=') ? TOK_POWASSIGN : TOK_POW;
else
#endif
tp->type = matchChar('=') ? TOK_MULASSIGN : TOK_MUL;
goto out;

Просмотреть файл

@ -16,7 +16,7 @@ function check_one(expected, f, err) {
throw new Error("didn't fail");
}
ieval = eval;
function check(expr, expected=expr) {
function check(expr, expected=expr, testStrict=true) {
var end, err;
for ([end, err] of [[".random_prop", " is undefined"], ["()", " is not a function"]]) {
var statement = "o = {};" + expr + end, f;
@ -47,6 +47,11 @@ function check(expr, expected=expr) {
Function("with ({}) {} var undef, o; for (let z in [1, 2]) { " + statement + " }"),
];
if (testStrict) {
// Strict mode.
cases.push(Function("o", "undef", "\"use strict\";\n" + statement));
}
for (var f of cases) {
check_one(expected, f, err);
}
@ -67,12 +72,15 @@ check("o[65536]");
check("o[268435455]");
check("o['1.1']");
check("o[4 + 'h']", "o['4h']");
check("this.x");
check("ieval(undef)", "ieval(...)");
check("ieval.call()", "ieval.call(...)");
check("ieval(...[])", "ieval(...)");
check("ieval(...[undef])", "ieval(...)");
check("ieval(...[undef, undef])", "ieval(...)");
check("(o[0] = 4).foo", "o[0].foo");
// NOTE: This one produces different output in strict mode since "this" is
// undefined in that case.
check("this.x", "this.x", false);
for (let tok of ["|", "^", "&", "==", "!==", "===", "!==", "<", "<=", ">", ">=",
">>", "<<", ">>>", "+", "-", "*", "/", "%"]) {
@ -110,5 +118,20 @@ catch (e)
assertEq(e.message, "can't convert null to object");
}
try {
(function() {
"use strict";
var o = [];
Object.freeze(o);
o[0] = "foo";
}());
throw new Error("didn't throw");
} catch (e) {
assertEq(e instanceof TypeError, true,
"expected TypeError, got " + e);
assertEq(e.message,
"can't define array index property past the end of an array with non-writable length");
}
// Check fallback behavior
assertThrowsInstanceOf(function () { for (let x of undefined) {} }, TypeError);

Просмотреть файл

@ -119,6 +119,15 @@ assertEq(exp2.load(3*64*1024), 99);
assertEq(mem.buffer.byteLength, 4*64*1024);
assertEq(new Int32Array(mem.buffer)[3*64*1024/4], 99);
// Fail at maximum
var mem = new Memory({initial:1, maximum:2});
assertEq(mem.buffer.byteLength, 1 * 64*1024);
assertEq(mem.grow(1), 1);
assertEq(mem.buffer.byteLength, 2 * 64*1024);
assertErrorMessage(() => mem.grow(1), RangeError, /failed to grow memory/);
assertEq(mem.buffer.byteLength, 2 * 64*1024);
// ======
// TABLE
// ======
@ -214,3 +223,12 @@ assertEq(exp2.call_indirect(0), 1);
assertEq(exp2.call_indirect(1), 2);
assertErrorMessage(() => exp2.call_indirect(2), Error, /indirect call to null/);
assertErrorMessage(() => exp2.call_indirect(3), Error, /indirect call to null/);
// Fail at maximum
var tbl = new Table({initial:1, maximum:2, element:"anyfunc"});
assertEq(tbl.length, 1);
assertEq(tbl.grow(1), 1);
assertEq(tbl.length, 2);
assertErrorMessage(() => tbl.grow(1), RangeError, /failed to grow table/);
assertEq(tbl.length, 2);

Просмотреть файл

@ -351,7 +351,6 @@ MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 1, JSEXN_WARN, "Successfully compiled
MSG_DEF(JSMSG_WASM_COMPILE_ERROR, 1, JSEXN_WASMCOMPILEERROR, "{0}")
MSG_DEF(JSMSG_WASM_IND_CALL_TO_NULL, 0, JSEXN_WASMRUNTIMEERROR, "indirect call to null")
MSG_DEF(JSMSG_WASM_IND_CALL_BAD_SIG, 0, JSEXN_WASMRUNTIMEERROR, "indirect call signature mismatch")
MSG_DEF(JSMSG_WASM_BAD_GROW, 1, JSEXN_WASMRUNTIMEERROR, "failed to grow {0}")
MSG_DEF(JSMSG_WASM_UNREACHABLE, 0, JSEXN_WASMRUNTIMEERROR, "unreachable executed")
MSG_DEF(JSMSG_WASM_INTEGER_OVERFLOW, 0, JSEXN_WASMRUNTIMEERROR, "integer overflow")
MSG_DEF(JSMSG_WASM_INVALID_CONVERSION, 0, JSEXN_WASMRUNTIMEERROR, "invalid conversion to integer")
@ -359,6 +358,7 @@ MSG_DEF(JSMSG_WASM_INT_DIVIDE_BY_ZERO, 0, JSEXN_WASMRUNTIMEERROR, "integer divid
MSG_DEF(JSMSG_WASM_OUT_OF_BOUNDS, 0, JSEXN_WASMRUNTIMEERROR, "index out of bounds")
MSG_DEF(JSMSG_WASM_UNALIGNED_ACCESS, 0, JSEXN_WASMRUNTIMEERROR, "unaligned memory access")
MSG_DEF(JSMSG_WASM_BAD_UINT32, 2, JSEXN_RANGEERR, "bad {0} {1}")
MSG_DEF(JSMSG_WASM_BAD_GROW, 1, JSEXN_RANGEERR, "failed to grow {0}")
MSG_DEF(JSMSG_WASM_BAD_FIT, 2, JSEXN_RANGEERR, "{0} segment does not fit in {1}")
MSG_DEF(JSMSG_WASM_BAD_BUF_ARG, 0, JSEXN_TYPEERR, "first argument must be an ArrayBuffer or typed array object")
MSG_DEF(JSMSG_WASM_BAD_MOD_ARG, 0, JSEXN_TYPEERR, "first argument must be a WebAssembly.Module")

Просмотреть файл

@ -354,7 +354,7 @@ class BytecodeParser
uint32_t offset = offsetForStackOperand(script_->pcToOffset(pc), operand);
if (offset >= SpecialOffsets::FirstSpecialOffset)
return nullptr;
return script_->offsetToPC(offsetForStackOperand(script_->pcToOffset(pc), operand));
return script_->offsetToPC(offset);
}
private:
@ -1265,6 +1265,16 @@ ExpressionDecompiler::decompilePC(jsbytecode* pc)
return write("super.") &&
quote(prop, '\0');
}
case JSOP_SETELEM:
case JSOP_STRICTSETELEM:
// NOTE: We don't show the right hand side of the operation because
// it's used in error messages like: "a[0] is not readable".
//
// We could though.
return decompilePCForStackOperand(pc, -3) &&
write("[") &&
decompilePCForStackOperand(pc, -2) &&
write("]");
case JSOP_GETELEM:
case JSOP_CALLELEM:
return decompilePCForStackOperand(pc, -2) &&

Просмотреть файл

@ -37,11 +37,4 @@
*/
#define JS_OLD_GETTER_SETTER_METHODS 1
#ifdef NIGHTLY_BUILD
/* Support for ES7 Exponentiation proposal. */
#define JS_HAS_EXPONENTIATION 1
#endif // NIGHTLY_BUILD
#endif /* jsversion_h */

Просмотреть файл

@ -9,8 +9,6 @@ var summary = "Implement the exponentiation operator";
print(BUGNUMBER + ": " + summary);
var test = `
// Constant folding
assertEq(2 ** 2 ** 3, 256);
assertEq(1 ** 1 ** 4, 1);
@ -115,26 +113,5 @@ assertEq(parseTree.body[0].expression.right.operator, "**");
assertEq(parseTree.body[0].expression.right.left.name, "b");
assertEq(parseTree.body[0].expression.right.right.name, "c");
function assertTrue(v) {
assertEq(v, true);
}
function assertFalse(v) {
assertEq(v, false);
}
`;
function exponentiationEnabled() {
try {
Function("1 ** 1");
return true;
} catch (e if e instanceof SyntaxError) { }
return false;
}
if (exponentiationEnabled())
eval(test);
if (typeof reportCompare === "function")
reportCompare(true, true);

Просмотреть файл

@ -4617,7 +4617,8 @@ pref("gfx.direct2d.force-enabled", false);
pref("layers.prefer-opengl", false);
pref("layers.prefer-d3d9", false);
pref("layers.allow-d3d9-fallback", true);
// Disable for now due to bug 1304360
pref("layers.allow-d3d9-fallback", false);
#endif
// Copy-on-write canvas

Просмотреть файл

@ -19,9 +19,8 @@
#include "nsIDNSListener.h"
#include "nsICancelable.h"
#include "nsThreadUtils.h"
#include "nsIURL.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include "nsIFileProtocolHandler.h"
#include "mozilla/Logging.h"
#include "mozilla/net/DNS.h"
#include "mozilla/Unused.h"
@ -133,9 +132,21 @@ private:
nsresult rv;
MOZ_ASSERT(aProxyAddr);
nsCOMPtr<nsIProtocolHandler> protocolHandler(
do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", &rv));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsIFileProtocolHandler> fileHandler(
do_QueryInterface(protocolHandler, &rv));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsIFile> socketFile;
rv = NS_GetFileFromURLSpec(aDomainSocketPath,
getter_AddRefs(socketFile));
rv = fileHandler->GetFileFromURLSpec(aDomainSocketPath,
getter_AddRefs(socketFile));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

Просмотреть файл

@ -171,8 +171,11 @@ def _repack(app_finder, l10n_finder, copier, formatter, non_chrome=set()):
files = [f for p, f in l10n_finder.find(path)]
if not len(files):
if base not in non_chrome:
finderBase = ""
if hasattr(l10n_finder, 'base'):
finderBase = l10n_finder.base
errors.error("Missing file: %s" %
os.path.join(l10n_finder.base, path))
os.path.join(finderBase, path))
else:
packager.add(path, files[0])
else:

Просмотреть файл

@ -719,6 +719,9 @@ public:
case __NR_umask:
case __NR_kill:
case __NR_wait4:
#ifdef __NR_waitpid
case __NR_waitpid:
#endif
#ifdef __NR_arch_prctl
case __NR_arch_prctl:
#endif

Просмотреть файл

@ -33,7 +33,7 @@
"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],
"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],
"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],
"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,null,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],
"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],
"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],
"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],
"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],

Просмотреть файл

@ -28,7 +28,7 @@ var singleByteEncodings = [
{encoding: 'windows-1252', bad: []},
{encoding: 'windows-1253', bad: [0xAA, 0xD2, 0xFF]},
{encoding: 'windows-1254', bad: []},
{encoding: 'windows-1255', bad: [0xCA, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xFB, 0xFC, 0xFF]},
{encoding: 'windows-1255', bad: [0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xFB, 0xFC, 0xFF]},
{encoding: 'windows-1256', bad: []},
{encoding: 'windows-1257', bad: [0xA1, 0xA5]},
{encoding: 'windows-1258', bad: []},

Просмотреть файл

@ -67,6 +67,20 @@ browser.engagement:
- rweiss@mozilla.com
release_channel_collection: opt-out
unfiltered_uri_count:
bug_numbers:
- 1304647
description: >
The count of the total non-unique URIs visited in a subsession, not restricted to
a specific protocol, including page reloads and about:* pages (other than initial
pages such as about:blank, ...), after the session has been restored. This does
not include background page requests and URIs from embedded pages or private browsing.
expires: "55"
kind: uint
notification_emails:
- bcolloran@mozilla.com
release_channel_collection: opt-out
unique_domains_count:
bug_numbers:
- 1271310

Просмотреть файл

@ -23,6 +23,7 @@
#include "nsCRT.h"
#include "nsThreadUtils.h"
#include "nsIObserverService.h"
#include "nsXULAppAPI.h"
#include "mozilla/Services.h"
#include <stdlib.h>
@ -430,6 +431,9 @@ nsresult
nsProcess::RunProcess(bool aBlocking, char** aMyArgv, nsIObserver* aObserver,
bool aHoldWeak, bool aArgsUTF8)
{
NS_WARNING_ASSERTION(!XRE_IsContentProcess(),
"No launching of new processes in the content process");
if (NS_WARN_IF(!mExecutable)) {
return NS_ERROR_NOT_INITIALIZED;
}