From 740bcd892d22136873b2b123b94e51bf6e77b8f9 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 1 Sep 2017 12:40:05 -0700 Subject: 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 Reviewed-by: dsinclair --- core/fxcrt/fx_unicode.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 core/fxcrt/fx_unicode.h (limited to 'core/fxcrt/fx_unicode.h') 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(prop & FX_CHARTYPEBITSMASK); +} + +wchar_t FX_GetMirrorChar(wchar_t wch, uint32_t dwProps); + +#endif // PDF_ENABLE_XFA + +#endif // CORE_FXCRT_FX_UNICODE_H_ -- cgit v1.2.3