Qt 4.8
qharfbuzz.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qunicodetables_p.h"
43 #include "qlibrary.h"
44 #include "qtextcodec.h"
45 
46 #include "qharfbuzz_p.h"
47 
49 
50 extern "C" {
51 
52 HB_GraphemeClass HB_GetGraphemeClass(HB_UChar32 ch)
53 {
55  return (HB_GraphemeClass) prop->graphemeBreak;
56 }
57 
58 HB_WordClass HB_GetWordClass(HB_UChar32 ch)
59 {
61  return (HB_WordClass) prop->wordBreak;
62 }
63 
64 HB_SentenceClass HB_GetSentenceClass(HB_UChar32 ch)
65 {
67  return (HB_SentenceClass) prop->sentenceBreak;
68 }
69 
70 HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch)
71 {
72  return (HB_LineBreakClass)QUnicodeTables::lineBreakClass(ch);
73 }
74 
75 
76 void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme, HB_LineBreakClass *lineBreak)
77 {
79  *grapheme = (HB_GraphemeClass) prop->graphemeBreak;
80  *lineBreak = (HB_LineBreakClass) prop->line_break_class;
81 }
82 
83 void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass)
84 {
86  *category = (HB_CharCategory)prop->category;
87  *combiningClass = prop->combiningClass;
88 }
89 
90 HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch)
91 {
92  return (HB_CharCategory)QChar::category(ch);
93 }
94 
96 {
97  return QChar::combiningClass(ch);
98 }
99 
100 HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
101 {
102  return QChar::mirroredChar(ch);
103 }
104 
105 void *HB_Library_Resolve(const char *library, int version, const char *symbol)
106 {
107 #ifdef QT_NO_LIBRARY
108  return 0;
109 #else
110  return QLibrary::resolve(QLatin1String(library), version, symbol);
111 #endif
112 }
113 
114 } // extern "C"
115 
117 
118 HB_Bool qShapeItem(HB_ShaperItem *item)
119 {
120  return HB_ShapeItem(item);
121 }
122 
123 HB_Face qHBNewFace(void *font, HB_GetFontTableFunc tableFunc)
124 {
125  return HB_NewFace(font, tableFunc);
126 }
127 
128 void qHBFreeFace(HB_Face face)
129 {
130  HB_FreeFace(face);
131 }
132 
133 void qGetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
134  const HB_ScriptItem *items, hb_uint32 numItems,
135  HB_CharAttributes *attributes)
136 {
137  HB_GetCharAttributes(string, stringLength, items, numItems, attributes);
138 }
139 
HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
Definition: qharfbuzz.cpp:100
void qHBFreeFace(HB_Face face)
Definition: qharfbuzz.cpp:128
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme, HB_LineBreakClass *lineBreak)
Definition: qharfbuzz.cpp:76
int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch)
Definition: qharfbuzz.cpp:95
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
Definition: qlibrary.cpp:1155
Category category() const
Returns the character's category.
Definition: qchar.cpp:853
HB_WordClass HB_GetWordClass(HB_UChar32 ch)
Definition: qharfbuzz.cpp:58
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4)
QChar mirroredChar() const
Returns the mirrored character if this character is a mirrored character; otherwise returns the chara...
Definition: qchar.cpp:1016
void * HB_Library_Resolve(const char *library, int version, const char *symbol)
Definition: qharfbuzz.cpp:105
HB_Face qHBNewFace(void *font, HB_GetFontTableFunc tableFunc)
Definition: qharfbuzz.cpp:123
HB_SentenceClass HB_GetSentenceClass(HB_UChar32 ch)
Definition: qharfbuzz.cpp:64
HB_GraphemeClass HB_GetGraphemeClass(HB_UChar32 ch)
Definition: qharfbuzz.cpp:52
HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch)
Definition: qharfbuzz.cpp:90
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.
Definition: qglobal.h:88
void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass)
Definition: qharfbuzz.cpp:83
unsigned char combiningClass() const
Returns the combining class for the character as defined in the Unicode standard. ...
Definition: qchar.cpp:1153
HB_Bool qShapeItem(HB_ShaperItem *item)
Definition: qharfbuzz.cpp:118
HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch)
Definition: qharfbuzz.cpp:70
void qGetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength, const HB_ScriptItem *items, hb_uint32 numItems, HB_CharAttributes *attributes)
Definition: qharfbuzz.cpp:133
Q_CORE_EXPORT const Properties *QT_FASTCALL properties(uint ucs4)