2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * This is part of HarfBuzz, an OpenType Layout engine library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 #include <harfbuzz-external.h>
26 #include <Qt/private/qunicodetables_p.h>
32 HB_LineBreakClass
HB_GetLineBreakClass(HB_UChar32 ch
)
34 #if QT_VERSION >= 0x040300
35 return (HB_LineBreakClass
)QUnicodeTables::lineBreakClass(ch
);
37 #error "This test currently requires Qt >= 4.3"
41 void HB_GetUnicodeCharProperties(HB_UChar32 ch
, HB_CharCategory
*category
, int *combiningClass
)
43 *category
= (HB_CharCategory
)QChar::category(ch
);
44 *combiningClass
= QChar::combiningClass(ch
);
47 HB_CharCategory
HB_GetUnicodeCharCategory(HB_UChar32 ch
)
49 return (HB_CharCategory
)QChar::category(ch
);
52 int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch
)
54 return QChar::combiningClass(ch
);
57 HB_UChar16
HB_GetMirroredChar(HB_UChar16 ch
)
59 return QChar::mirroredChar(ch
);
62 HB_WordClass
HB_GetWordClass(HB_UChar32 ch
)
64 const QUnicodeTables::Properties
*prop
= QUnicodeTables::properties(ch
);
65 return (HB_WordClass
) prop
->wordBreak
;
69 HB_SentenceClass
HB_GetSentenceClass(HB_UChar32 ch
)
71 const QUnicodeTables::Properties
*prop
= QUnicodeTables::properties(ch
);
72 return (HB_SentenceClass
) prop
->sentenceBreak
;
75 void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch
, HB_GraphemeClass
*grapheme
, HB_LineBreakClass
*lineBreak
)
77 const QUnicodeTables::Properties
*prop
= QUnicodeTables::properties(ch
);
78 *grapheme
= (HB_GraphemeClass
) prop
->graphemeBreak
;
79 *lineBreak
= (HB_LineBreakClass
) prop
->line_break_class
;
82 void *HB_Library_Resolve(const char *library
, int version
, const char *symbol
)
84 return QLibrary::resolve(library
, version
, symbol
);