Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the ability to remove arabic, and farsi support. #1867

Closed
wants to merge 2 commits into from

Conversation

CRThaze
Copy link

@CRThaze CRThaze commented Jul 23, 2017

Not sure if this is the correct way to add these configure script features. And I'm also not sure why autoconf now wants to remove the runstatedir flag. I figured I'd go ahead and submit this pull request for your review, so that I might get some pointers on what I might need to fix or if I'm even going about this the right way.

@codecov-io
Copy link

Codecov Report

Merging #1867 into master will increase coverage by 0.19%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1867      +/-   ##
==========================================
+ Coverage   75.06%   75.25%   +0.19%     
==========================================
  Files          76       74       -2     
  Lines      125274   123243    -2031     
==========================================
- Hits        94032    92750    -1282     
+ Misses      31242    30493     -749
Impacted Files Coverage Δ
src/mbyte.c 61.37% <0%> (-0.68%) ⬇️
src/misc1.c 82.22% <0%> (-0.24%) ⬇️
src/normal.c 71.41% <0%> (-0.22%) ⬇️
src/if_xcmdsrv.c 83.33% <0%> (-0.19%) ⬇️
src/charset.c 86.88% <0%> (-0.13%) ⬇️
src/option.c 84.08% <0%> (-0.06%) ⬇️
src/main.c 55.31% <0%> (-0.05%) ⬇️
src/regexp_nfa.c 90.61% <0%> (-0.05%) ⬇️
src/getchar.c 73.34% <0%> (-0.03%) ⬇️
src/ex_docmd.c 74.75% <0%> (-0.03%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81bdd6a...32e807c. Read the comment docs.

@tonymec
Copy link

tonymec commented Jul 24, 2017

Note that even with no change in the configure script, it is already possible to define or undefine FEAT_RIGHTLEFT, FEAT_ARABIC and/or FEAT_FKMAP in feature.h (which sets +rightleft if either +arabic or +farsi is requested). ATM they are enabled in Big and Huge builds except in EBCDIC, and disabled in other builds. +multi_byte is of course required. IIUC +rightleft alone (and +multi_byte required by it) is sufficient for Hebrew script.
OTOH, the whole +farsi feature is in jeopardy these days, there is question of removing it altogether and letting Farsi script support be handled by +arabic which is more general.

Best regards,
Tony.

@CRThaze
Copy link
Author

CRThaze commented Jul 24, 2017

Yes, I myself regularly build with the Huge feature set, however these specific features are not needed, so I figured it'd be nice to just be able to toggle these off through the configure script instead of always having to edit features.h

@k-takata k-takata added the i18n internationalization and/or localization label Oct 12, 2017
@typoman
Copy link

typoman commented Nov 19, 2018

I wanted to add that having farsi and arabic features in OSX terminal, breaks the native terminal Arabic shaping and shows incorrect results inside vim. I'm trying to disable them but I get:
unrecognized options: --disable-farsi

I have no idea how this feature would show up in different Unix terminals but as a native to Arabic script, I totally recommend removing them from huge build option.

@tonymec
Copy link

tonymec commented Nov 19, 2018

I wanted to add that having farsi and arabic features in OSX terminal, breaks the native terminal Arabic shaping and shows incorrect results inside vim. I'm trying to disable them but I get:
unrecognized options: --disable-farsi

I have no idea how this feature would show up in different Unix terminals but as a native to Arabic script, I totally recommend removing them from huge build option.

I don't recommend disabling them but rather using them properly in the manner outlined lower down this post; however they can be disabled at compile-time as follows:

There is indeed no --disable-farsi in configure, but, as I said earlier, you can arrive at the same result by commenting-out line 277 (# define FEAT_FKMAP) of feature.h. Similarly for Arabic at line 292 and right-left editing at line 267.

The Vim source is distributed via a Git repository at github and a Mercurial mirror at bitbucket. I use Mercurial and https://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial explains (under the heading "Complex case: You have local changes and/or" (etc.)) how I make Mercurial keep my feature.h changes from one update to the next without having to add them myself again and again. (I hope I've told it clearly.)

Now how to use them properly and avoid "breaking" Arabic display:

Even with +rightleft set, there are still two other problems: (1) Vim has no knowledge of bidirectionality, and (2) only some fonts possess glyphs for the Arabic script. Let's tackle them in turn.

  1. Bidirectionality: In gvim, or in Vim running in a terminal with no special bidi features, whole lines are displayed either left-to-right (with 'norightleft' which is the default) or right-to-left (with 'rightleft' which is not the default but is set implicitly by :set arabic), regardless of the characters' inherent LTR or RTL directionality. With 'termbidi' set (which is not the default except if $TERM is mlterm) Vim disregards the 'rightleft' option and lets the terminal handle bidirectionality. This only works if Vim (not gvim) is running in a terminal which is aware of the requirements of true bidirectionality. One such terminal is mlterm, which may or may not be available where you usually get the software packages for your OS (where I get mine, it isn't), but IIRC it is also available in C source form at SourceForge. Vim knows about this one; if your terminal has true-bidi capabilities but doesn't call itself mlterm via the $TERM environment variable, you can :set termbidi yourself. I think the vimrc is the proper place for that if you can detect there that Vim is running in a true-bidi terminal other than mlterm.
  2. Arabic glyphs: For gvim (which, however, has no true-bidi capabilities) you can change the font by means of the 'guifont' option. This may require some trial and error. The Arabeyes project distributes (or used to distribute) Arabic fonts whose names all start with ae_ but of course there are other such fonts; maybe you even already have some. OTOH, to change fonts in a terminal you must set the appropriate terminal settings, and each terminal does this differently: You should read the appropriate terminal's (e.g. mlterm's) documentation.
  3. Arabic shaping: In Vim (including gvim), this is not a problem. If either 'rightleft' is set (in gvim or in a non-full-bidi terminal) or 'termbidi' is set (in a full-bidi terminal), then Vim (compiled with +arabic, and with 'arabicshape' set at its default "on" setting) handles Arabic shaping beautifully, and in particular displays the proper Unicode "complex characters" for laam-alif (isolate or final depending on context), lillāh and Allāh when the separate laam-alif, laam-laam-heh or alif-laam-laam-heh sequences are used — provided that no combining characters (and in particular no harakat, sukuun, shadda, etc.) are interspersed between them. (Most Arabic fonts include an alif-superscript dot on top of the second laam of the precomposed lillāh or Allāh glyph anyway.)

Best regards,
Tony.

@brammool brammool closed this in 5c5697f Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n internationalization and/or localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants