DRC | 2ff39b8 | 2011-07-28 08:38:59 +0000 | [diff] [blame^] | 1 | /* "$Id: $" |
| 2 | * |
| 3 | * Author: Jean-Marc Lienher ( http://oksid.ch ) |
| 4 | * Copyright 2000-2010 by O'ksi'D. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 | * USA. |
| 20 | * |
| 21 | * Please report all bugs and problems on the following page: |
| 22 | * |
| 23 | * http://www.fltk.org/str.php |
| 24 | */ |
| 25 | |
| 26 | /* |
| 27 | * This file is required on all platforms for utf8 support |
| 28 | */ |
| 29 | |
| 30 | unsigned short |
| 31 | XUtf8IsRightToLeft(unsigned int ucs) { |
| 32 | |
| 33 | #if 0 |
| 34 | /* for debug only */ |
| 35 | if (ucs <= 0x005A) { |
| 36 | if (ucs >= 0x0041) return 1; |
| 37 | return 0; |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | /* HEBREW */ |
| 42 | if (ucs <= 0x05F4) { |
| 43 | if (ucs >= 0x0591) return 1; |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | /* ARABIC */ |
| 48 | if (ucs <= 0x06ED) { |
| 49 | if (ucs >= 0x060C) return 1; |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | if (ucs <= 0x06F9) { |
| 54 | if (ucs >= 0x06F0) return 1; |
| 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | if (ucs == 0x200F) return 1; |
| 59 | |
| 60 | if (ucs == 0x202B) return 1; |
| 61 | |
| 62 | if (ucs == 0x202E) return 1; |
| 63 | |
| 64 | if (ucs <= 0xFB4F) { |
| 65 | if (ucs >= 0xFB1E) return 1; |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | if (ucs <= 0xFDFB) { |
| 70 | if (ucs >= 0xFB50) return 1; |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | if (ucs <= 0xFEFC) { |
| 75 | if (ucs >= 0xFE70) return 1; |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | /* |
| 83 | * End of "$Id$". |
| 84 | */ |