diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-09-01 12:40:05 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-05 14:03:36 +0000 |
commit | 740bcd892d22136873b2b123b94e51bf6e77b8f9 (patch) | |
tree | 86bcc39a487163e2bfe6858d84393ef52ad09ef2 /core/fxcrt/fx_unicode.h | |
parent | 3c5944c93445bb40c2131ea6782e8cc8b673bffb (diff) | |
download | pdfium-740bcd892d22136873b2b123b94e51bf6e77b8f9.tar.xz |
Split fx_ucd.h into fx_unicode.h and fx_ucddata.h.
File naming now matches.
Fix one usage not going through the accessor function.
Change-Id: I5cc4986238764964f2a71807a94bd2facf517263
Reviewed-on: https://pdfium-review.googlesource.com/12930
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_unicode.h')
-rw-r--r-- | core/fxcrt/fx_unicode.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/core/fxcrt/fx_unicode.h b/core/fxcrt/fx_unicode.h new file mode 100644 index 0000000000..a4a237ae6d --- /dev/null +++ b/core/fxcrt/fx_unicode.h @@ -0,0 +1,48 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXCRT_FX_UNICODE_H_ +#define CORE_FXCRT_FX_UNICODE_H_ + +#include "core/fxcrt/cfx_retain_ptr.h" + +uint32_t FX_GetUnicodeProperties(wchar_t wch); +wchar_t FX_GetMirrorChar(wchar_t wch); + +#ifdef PDF_ENABLE_XFA + +// As defined in http://www.unicode.org/reports/tr14 +constexpr uint8_t kBreakPropertySpace = 35; +constexpr uint8_t kBreakPropertyTB = 37; // Don't know what this is ... + +constexpr uint32_t FX_CHARTYPEBITS = 11; +constexpr uint32_t FX_CHARTYPEBITSMASK = 0xF << FX_CHARTYPEBITS; + +enum FX_CHARTYPE { + FX_CHARTYPE_Unknown = 0, + FX_CHARTYPE_Tab = (1 << FX_CHARTYPEBITS), + FX_CHARTYPE_Space = (2 << FX_CHARTYPEBITS), + FX_CHARTYPE_Control = (3 << FX_CHARTYPEBITS), + FX_CHARTYPE_Combination = (4 << FX_CHARTYPEBITS), + FX_CHARTYPE_Numeric = (5 << FX_CHARTYPEBITS), + FX_CHARTYPE_Normal = (6 << FX_CHARTYPEBITS), + FX_CHARTYPE_ArabicAlef = (7 << FX_CHARTYPEBITS), + FX_CHARTYPE_ArabicSpecial = (8 << FX_CHARTYPEBITS), + FX_CHARTYPE_ArabicDistortion = (9 << FX_CHARTYPEBITS), + FX_CHARTYPE_ArabicNormal = (10 << FX_CHARTYPEBITS), + FX_CHARTYPE_ArabicForm = (11 << FX_CHARTYPEBITS), + FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS), +}; + +inline FX_CHARTYPE GetCharTypeFromProp(uint32_t prop) { + return static_cast<FX_CHARTYPE>(prop & FX_CHARTYPEBITSMASK); +} + +wchar_t FX_GetMirrorChar(wchar_t wch, uint32_t dwProps); + +#endif // PDF_ENABLE_XFA + +#endif // CORE_FXCRT_FX_UNICODE_H_ |