Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Proportional Spaced Fonts

 [1/3] from: louisaturk:coxinet at: 23-Oct-2002 6:44


Hi rebols, Let's say we have two lines of text---one of Greek and one an English translation---, and that we want to line up the words of the translation directly under the Greek words. Bibloj genesewj Ihsou Cristou , uiou Dabid , uiou Abraam . Book generation Jesus Christ , son David , son Abraham . With fixed width fonts (such as Courier) this is easy. But how is it done with proportional spaced fonts? Also, how do you figure the spacing of the Greek accent and breathing marks which are actually another character as is seen when viewed without the appropriate Greek font? Bi,bloj gene,sewj VIhsou/ Cristou/( ui`ou/ Dabi.d( ui`ou/ VAbraa,m=C5 Book generation Jesus Christ, son David, son Abraham . Of course, I realize that there are problems in even showing you this problem, as different email clients are going to display this message differently---probably radically so. Louis

 [2/3] from: greggirwin:mindspring at: 23-Oct-2002 12:00


Hi Louis, << Let's say we have two lines of text---one of Greek and one an English translation---, and that we want to line up the words of the translation directly under the Greek words. Bibloj genesewj Ihsou Cristou , uiou Dabid , uiou Abraam . Book generation Jesus Christ , son David , son Abraham .
>>
I know nothing about Greek, so this is just a general approach, which may not correctly account for the accents and breathing marks you mentioned. You can display the text in many ways. If you need seamless editing to go along with it, that's a bit tricker perhaps. First, you could use TEXT faces and let REBOL do all the work for you: b1: parse "Bibloj genesewj Ihsou Cristou uiou Dabid uiou Abraam" none b2: parse "Book generation Jesus Christ son David son Abraham" none lay-blk: [space 0x0] repeat i length? b1 [ append lay-blk reduce ['text b1/:i 'text b2/:i 'return] ] view layout lay-blk If that isn't suitable, you could set each word into a face and use the SIZE-TEXT function to find out how wide the text is, then do something else, like find the wider of the pair of words and add them to the effect/draw block for a face, using the calculated offsets. --Gregg

 [3/3] from: louisaturk:coxinet at: 23-Oct-2002 22:37


Hi Gregg, At 12:00 PM 10/23/2002 -0600, you wrote:
>Hi Louis, ><<
<<quoted lines omitted: 18>>
>] >view layout lay-blk
I'm still studying this.
>If that isn't suitable, you could set each word into a face and use the >SIZE-TEXT function to find out how wide the text is, then do something else, >like find the wider of the pair of words and add them to the effect/draw >block for a face, using the calculated offsets.
This definitely will work. I made a test program, and a letter with an accent mark is shown as the same width as a letter without the accent mark. I am playing with this. I'll probably have some more questions later. Many thanks! this is a big breakthrough for me. I have been trying to figure out how to do this for several years, and it is this simple with rebol! Louis

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted