AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
For mac instal Office.Files.Images 2.453/29/2024 ![]() Arabic (and other languages like Farsi that use much the same script) have an additional need. ![]() This should be sufficient to display Hebrew properly, for example. RTL fixes the left-to-right display of what should be right-to-left text by applying the bidirectional algorithm. These capacities rely on the `bidi` and `arabic_reshaper` packages. That parameter has also now been exposed via the Builder Text component Settled on adding a single 'languageStyle' parameter in the TextStim initialisation, with options 'LTR', 'RTL', or 'Arabic', instead of two boolean parameters (`bidirectional` and `arabicReshape`). # to reshape Arabic characters from their isolated form:īegin routine: reshaped_text = arabic_reshaper.reshape(original_text) # reshape charactersįinal_text = algorithm.get_display(reshaped_text) # change to right-to-left If you get that to work, then the code I used was this:īegin experiment: # library for displaying right-to-left text correctly: Until we bundle the package, you’ll need to follow the instructions for that process here: If, however, like most people, you’re using a standalone PsychoPy distribution, accessing additional packages is more complicated. If using one’s own Python, installing a package like this is as simple as typing pip install arabic-reshaper in a terminal. ![]() I ran the example above using PsychoPy within my own Anaconda Python 3 installation, not using the standalone PsychoPy application. We would allow them to be applied independently, as I think Hebrew users for example only need the bidirectional algorithm, whereas, as you’ve shown, languages using the Arabic alphabet need the reshaping as well.īut you don’t need to wait for that development, and can just use the functions directly, just as you’ve already done in IDLE. ![]() Once that package is available, it would then become very easy to actually add its functionality (and the bidirectional algorithm) to PsychoPy’s text stimulus, and ideally make it available via the graphical text component in Builder as well. The best solution would be to bundle the arabic-reshaper package with the standalone PsychoPy distributions, so that all users get access to its functions as required. Hi Omid, thanks for your work and independent confirmation. ![]()
0 Comments
Read More
Leave a Reply. |