/* * Copyright © 2009 Red Hat, Inc. * Copyright © 2009 Keith Stribley * Copyright © 2011 Google, Inc. * * 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. * * Red Hat Author(s): Behdad Esfahbod * Google Author(s): Behdad Esfahbod */ #include "hb.hh" #ifdef HAVE_ICU #include "hb-icu.h" #include "hb-machinery.hh" #include <unicode/uchar.h> #include <unicode/unorm2.h> #include <unicode/ustring.h> #include <unicode/utf16.h> #include <unicode/uversion.h> /* ICU extra semicolon, fixed since 65, https://github.com/unicode-org/icu/commit/480bec3 */ #if U_ICU_VERSION_MAJOR_NUM < 65 && (defined(__GNUC__) || defined(__clang__)) #define HB_ICU_EXTRA_SEMI_IGNORED #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wextra-semi-stmt" #endif /** * SECTION:hb-icu * @title: hb-icu * @short_description: ICU integration * @include: hb-icu.h * * Functions for using HarfBuzz with the International Components for Unicode * (ICU) library. HarfBuzz supports using ICU to provide Unicode data, by attaching * ICU functions to the virtual methods in a #hb_unicode_funcs_t function * structure. **/ /** * hb_icu_script_to_script: * @script: The UScriptCode identifier to query * * Fetches the #hb_script_t script that corresponds to the * specified UScriptCode identifier. * * Return value: the #hb_script_t script found * **/ hb_script_t hb_icu_script_to_script (UScriptCode script) { … } /** * hb_icu_script_from_script: * @script: The #hb_script_t script to query * * Fetches the UScriptCode identifier that corresponds to the * specified #hb_script_t script. * * Return value: the UScriptCode identifier found * **/ UScriptCode hb_icu_script_from_script (hb_script_t script) { … } static hb_unicode_combining_class_t hb_icu_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t unicode, void *user_data HB_UNUSED) { … } static hb_unicode_general_category_t hb_icu_unicode_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t unicode, void *user_data HB_UNUSED) { … } static hb_codepoint_t hb_icu_unicode_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t unicode, void *user_data HB_UNUSED) { … } static hb_script_t hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t unicode, void *user_data HB_UNUSED) { … } static hb_bool_t hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t a, hb_codepoint_t b, hb_codepoint_t *ab, void *user_data) { … } static hb_bool_t hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t ab, hb_codepoint_t *a, hb_codepoint_t *b, void *user_data) { … } static inline void free_static_icu_funcs (); static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t<hb_icu_unicode_funcs_lazy_loader_t> { … } static_icu_funcs; static inline void free_static_icu_funcs () { … } /** * hb_icu_get_unicode_funcs: * * Fetches a Unicode-functions structure that is populated * with the appropriate ICU function for each method. * * Return value: (transfer none): a pointer to the #hb_unicode_funcs_t Unicode-functions structure * * Since: 0.9.38 **/ hb_unicode_funcs_t * hb_icu_get_unicode_funcs () { … } #ifdef HB_ICU_EXTRA_SEMI_IGNORED #pragma GCC diagnostic pop #endif #endif