Multiple new lines in user defined flashcards

#1
Perhaps this the flashcard exchange thread but hope to reach a larger audience here.

Is there a way to introduce new lines in user generated definitions so that difference "meanings" can be numbered and start on new lines (i.e. formatted line the cards generated from dictionary entries)?
 
#2
Hi sopsku,

yes, there are a few Unicode codes Pleco 3.2 currently uses for that. In the long run, they will be replaced by a more modern format, though.

------------- (Copied from a post by @alex_hk90) ---------------

Pleco dictionary formatting special codes (unofficial, subject to change) [private use Unicode]:
---
EAB1 = new line
EAB2/EAB3 = bold
EAB4/EAB5 = italic
EAB8/EABB = "copy-whatever's-in-this-to-the-Input-Field hyperlinks"
coloured text:
"EAC1 followed by two characters with the highest-order bit 1 and the lowest-order 12 bits representing the first/second halves of a 24-bit RGB color value to start the range, EAC2 to end. So to render a character in green, for example, you'd want EAC1 800F 8F00, then the character, then EAC2."
---
UTF-8: U+EAB1 = '\xee\xaa\xb1'

------------------------------------------------------------------

The newline can also be copied and pasted from here (without the "<>"): <>

If you edit a user dictionary entry from within Pleco, you can enter regular newlines, but if you were to export them, they would be converted to spaces. You need this special newline character especially if you import and export, or if you prepare a user dictionary from a Mac/PC and import it into Pleco afterwards.

Hope this helps,

Shun
 

mikelove

皇帝
Staff member
#4
Well yeah, it was never intended to be something for users to work with. (Or us, directly at least - it’s spat out by our database encoder) Back on Palm OS it was a big performance win to get formatting data from a single character rather than a whole long tag.
 
#5
Understood. It's not a criticism, and yeah, you didn't intend users to be poking around this stuff.

The explanation is interesting though. Thanks!
 
#6
Hi Mike,

Sorry to bother you with asking for support for an unsupported feature, but I'm having a little trouble getting getting the colors to work based on what I think I've understood from the above.

I've written a program to take a source xml file defining the colors and convert it into a text file suitable for importing into a user dictionary.

From what I understand - if the text file is a UTF8 file with the following unicode character sequences, the colors will render in IOS pleco (ignore spaces - only there for readability):
EAC1 XXXX TEXT EAC2

Where XXXX is the encoded RGB values of the color you want TEXT to appear.

My test source file contains 8 colors, and I believe I have encoded them correctly. The following is raw dump of my calculations for the colors
- first is the RGB values
- then those RGB values converted into binary
- then those RGB values broken into 2 12 bit binary strings, with the top bit set to 1 according to what I understand of the encoding described above.
- then those encoded values converted back into hex
Code:
RRGGBB   rrrrrrrr gggggggg bbbbbbbb       aaaaaaaaaaaa     bbbbbbbbbbbb   HexA HexB   Color
------   -------- -------- --------   ---------------- ----------------   ---- ----   -------
000000 / 00000000 00000000 00000000 / 1000000000000000 1000000000000000 / 8000 8000 / Black
FFFFFF / 11111111 11111111 11111111 / 1000111111111111 1000111111111111 / 8fff 8fff / White
FF0000 / 11111111 00000000 00000000 / 1000111111110000 1000000000000000 / 8ff0 8000 / Red
00FF00 / 00000000 11111111 00000000 / 1000000000001111 1000111100000000 / 800f 8f00 / Green
0000FF / 00000000 00000000 11111111 / 1000000000000000 1000000011111111 / 8000 80ff / Blue
00FFFF / 00000000 11111111 11111111 / 1000000000001111 1000111111111111 / 800f 8fff / Cyan
FFFF00 / 11111111 11111111 00000000 / 1000111111111111 1000111100000000 / 8fff 8f00 / Yellow
FF00FF / 11111111 00000000 11111111 / 1000111111110000 1000000011111111 / 8ff0 80ff / Magenta
So, I'd expect that to encode for Yellow, the unicode sequence would be:
EAC1 8FF0 80FF YELLOW EAC2

When I import my text file (attached) with those unicode sequences, the yellow doesn't appear.

I do get some colors - black appears correct. There is a green. Cyan appears as a powder blue and the rest don't appear.

Can you see anything obvious that I'm doing wrong? Any advice or pointers would be greatly appreciated.
 

Attachments

#11
To have different colors in a user dictionary would be nice. As the (iOS) examples here don't seem to work with Android: Can somebody explane how to build the color codes for Android?
 
Top