This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathfoundation-bidi.h
More file actions
49 lines (38 loc) · 2.06 KB
/
foundation-bidi.h
File metadata and controls
49 lines (38 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Copyright (C) 2003-2015 LiveCode Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
#ifndef __MC_FOUNDATION_BIDI__
#define __MC_FOUNDATION_BIDI__
#include "foundation.h"
// The values assigned to these constants are significant: they represent the
// starting values in the Unicode BiDi algorithm and should not be changed.
enum MCTextDirection
{
kMCTextDirectionAuto = -1, // Detect based on contents
kMCTextDirectionLTR = 0, // Force left-to-right direction
kMCTextDirectionRTL = 1, // Force right-to-left direction
};
// Significant characters for BiDi processing
#define kMCBidiLRE 0x202A // Left-to-right embedding
#define kMCBidiRLE 0x202B // Right-to-left embedding
#define kMCBidiLRO 0x202D // Left-to-right override
#define kMCBidiRLO 0x202E // Right-to-left override
#define kMCBidiPDF 0x202C // Pop directional formatting
#define kMCBidiLRI 0x2066 // Left-to-right isolate
#define kMCBidiRLI 0x2067 // Right-to-left isolate
#define kMCBidiFSI 0x2068 // First strong isolate
#define kMCBidiPDI 0x2069 // Pop directional isolate
#define kMCBidiLRM 0x200E // Left-to-right mark
#define kMCBidiRLM 0x200F // Right-to-left mark
#define kMCBidiALM 0x061C // Arabic letter mark
bool MCBidiResolveTextDirection(MCStringRef p_string, intenum_t p_base_level, uint8_t *&r_levels, uindex_t& r_level_size);
uint8_t MCBidiFirstStrongIsolate(MCStringRef p_string, uindex_t p_offset);
#endif // __MC_FOUNDATION_BIDI__