fribidi-mirroring.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* fribidi-mirroring.h - get mirrored character
  2. *
  3. * Copyright (C) 2004 Sharif FarsiWeb, Inc
  4. * Copyright (C) 2001, 2002, 2004 Behdad Esfahbod
  5. * Copyright (C) 1999, 2000, 2017 Dov Grobgeld
  6. *
  7. * This file is part of GNU FriBidi.
  8. *
  9. * GNU FriBidi is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public License
  11. * as published by the Free Software Foundation; either version 2.1
  12. * of the License, or (at your option) any later version.
  13. *
  14. * GNU FriBidi is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with GNU FriBidi; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * For licensing issues, contact <fribidi.license@gmail.com> or write to
  24. * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
  25. *
  26. * Author(s):
  27. * Behdad Esfahbod, 2001, 2002, 2004
  28. * Dov Grobgeld, 1999, 2000
  29. */
  30. #ifndef _FRIBIDI_MIRRORING_H
  31. #define _FRIBIDI_MIRRORING_H
  32. #include "fribidi-common.h"
  33. #include "fribidi-types.h"
  34. #include "fribidi-bidi-types.h"
  35. #include "fribidi-begindecls.h"
  36. /* fribidi_get_mirror_char - get mirrored character
  37. *
  38. * This function finds the mirrored equivalent of a character as defined in
  39. * the file BidiMirroring.txt of the Unicode Character Database available at
  40. * http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt.
  41. *
  42. * If the input character is a declared as a mirroring character in the
  43. * Unicode standard and has a mirrored equivalent. The matching mirrored
  44. * character is put in the output, otherwise the input character itself is
  45. * put.
  46. *
  47. * Returns: if the character has a mirroring equivalent or not.
  48. */
  49. FRIBIDI_ENTRY fribidi_boolean fribidi_get_mirror_char (
  50. FriBidiChar ch, /* input character */
  51. FriBidiChar *mirrored_ch /* output mirrored character */
  52. );
  53. /* fribidi_shape_mirroring - do mirroring shaping
  54. *
  55. * This functions replaces mirroring characters on right-to-left embeddings in
  56. * string with their mirrored equivalent as returned by
  57. * fribidi_get_mirror_char().
  58. *
  59. * This function implements rule L4 of the Unicode Bidirectional Algorithm
  60. * available at http://www.unicode.org/reports/tr9/#L4.
  61. */
  62. FRIBIDI_ENTRY void fribidi_shape_mirroring (
  63. const FriBidiLevel *embedding_levels, /* input list of embedding
  64. levels, as returned by
  65. fribidi_get_par_embedding_levels */
  66. const FriBidiStrIndex len, /* input string length */
  67. FriBidiChar *str /* string to shape */
  68. );
  69. #include "fribidi-enddecls.h"
  70. #endif /* !_FRIBIDI_MIRRORING_H */
  71. /* Editor directions:
  72. * Local Variables:
  73. * mode: c
  74. * c-basic-offset: 2
  75. * indent-tabs-mode: t
  76. * tab-width: 8
  77. * End:
  78. * vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
  79. */