left-to-right

Width of string to the right of a point, in a bi-directional text

限于喜欢 提交于 2020-01-30 06:23:05
问题 *Sorry if the title is not great. I am not sure how to summarize this question into a few words. I have a DataGridView and a search box. When the user types a query, any matching result in the DataGridView cells, is highlighted. To achieve this I use the CellPainting event of DataGridView and draw a rectangle behind the results. Some of the cells are oriented Right-To-Left: And some are oriented Left-To-Right: When the orientation is RTL, I use the following formula to calculate the highlight

Width of string to the right of a point, in a bi-directional text

最后都变了- 提交于 2020-01-30 06:22:06
问题 *Sorry if the title is not great. I am not sure how to summarize this question into a few words. I have a DataGridView and a search box. When the user types a query, any matching result in the DataGridView cells, is highlighted. To achieve this I use the CellPainting event of DataGridView and draw a rectangle behind the results. Some of the cells are oriented Right-To-Left: And some are oriented Left-To-Right: When the orientation is RTL, I use the following formula to calculate the highlight

How to make right-to-left language (eg.Arabic) characters behave like left-to-right languages do in qt?

拈花ヽ惹草 提交于 2019-12-23 02:29:57
问题 Qt provides a powerful adaptive way to deal with left-to-right languages and right-to-left languages texts.But I encounter my problems dealing with my goals. Picture No.1 What I want to get Picture No.2 What I got when paste to my QTextEdit based widget what picture no.1 shows Picture No.3 What I got when I set text-direction to left-to-right as shown below: QTextDocument *doc = ui->textEdit->document(); QTextOption textOption = doc->defaultTextOption(); textOption.setTextDirection(Qt:

Right-to-Left and Left-to-Right printed nicely

时间秒杀一切 提交于 2019-12-18 07:03:29
问题 I want it to produce the number next to a word so that I can ask the user to select the word by using the corresponding number. This is my code alt_words = hlst loopnum = 8 for i in range(loopnum): if i < len(alt_words): print('{0}. {1:<20}'.format((i+1), alt_words[i]), end =' ') if i == 0: print('', end=' ') if i + 9 <= len(alt_words): print('{0}. {1:<20}'.format((i+9), alt_words[i+8]), end =' ') if i + 17 <= len(alt_words): print('{0}. {1:<20}'.format((i+17), alt_words[i+16]), end=' ')

How to detemine the current direction of a View (RTL/LTR)?

百般思念 提交于 2019-12-10 13:19:04
问题 Background It's possible to get the current locale direction, using this: val isRtl=TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL It's also possible to get the layout direction of a view, if the developer has set it: val layoutDirection = ViewCompat.getLayoutDirection(someView) The problem The default layoutDirection of a view isn't based on its locale. It's actually LAYOUT_DIRECTION_LTR . When you change the locale of the device from LTR

How to make right-to-left language (eg.Arabic) characters behave like left-to-right languages do in qt?

穿精又带淫゛_ 提交于 2019-12-06 22:10:38
Qt provides a powerful adaptive way to deal with left-to-right languages and right-to-left languages texts.But I encounter my problems dealing with my goals. Picture No.1 What I want to get Picture No.2 What I got when paste to my QTextEdit based widget what picture no.1 shows Picture No.3 What I got when I set text-direction to left-to-right as shown below: QTextDocument *doc = ui->textEdit->document(); QTextOption textOption = doc->defaultTextOption(); textOption.setTextDirection(Qt::LeftToRight); doc->setDefaultTextOption(textOption); ui->textEdit->setDocument(doc); Making it left-to-right

How to print Arabic characters in left-to-right direction

£可爱£侵袭症+ 提交于 2019-12-04 00:48:21
问题 I have a sequence of English and Arabic text that should be printed in an aligned way. For example: List<Character> ar = new ArrayList<Character>(); ar.add('ا'); ar.add('ب'); ar.add('ت'); List<Character> en = new ArrayList<Character>(); en.add('a'); en.add('b'); en.add('c'); System.out.println("ArArray: " + ar); System.out.println("EnArray: " + en); Expected Output: ArArray: [ت, ب, ا] // <- I want characters to be printed in the order they were added to the list EnArray: [a, b, c] Actual

How to print Arabic characters in left-to-right direction

坚强是说给别人听的谎言 提交于 2019-12-01 03:16:25
I have a sequence of English and Arabic text that should be printed in an aligned way. For example: List<Character> ar = new ArrayList<Character>(); ar.add('ا'); ar.add('ب'); ar.add('ت'); List<Character> en = new ArrayList<Character>(); en.add('a'); en.add('b'); en.add('c'); System.out.println("ArArray: " + ar); System.out.println("EnArray: " + en); Expected Output: ArArray: [ت, ب, ا] // <- I want characters to be printed in the order they were added to the list EnArray: [a, b, c] Actual Output: ArArray: [ا, ب, ت] // <- but they're printed in reverse order EnArray: [a, b, c] Is there a way to

Right-to-Left and Left-to-Right printed nicely

冷暖自知 提交于 2019-11-29 11:52:23
I want it to produce the number next to a word so that I can ask the user to select the word by using the corresponding number. This is my code alt_words = hlst loopnum = 8 for i in range(loopnum): if i < len(alt_words): print('{0}. {1:<20}'.format((i+1), alt_words[i]), end =' ') if i == 0: print('', end=' ') if i + 9 <= len(alt_words): print('{0}. {1:<20}'.format((i+9), alt_words[i+8]), end =' ') if i + 17 <= len(alt_words): print('{0}. {1:<20}'.format((i+17), alt_words[i+16]), end=' ') print('\n'+'-'*80) It produces this The first number of each line gets printed on the left, but the word on