2

PostScriptSpaceMod を計算し、以下を使用することで、行を揃えることができwidthhowます。

/SpaceMod % calculated from line width and stringwidth
/h { 0 32 } def 

/Times-Roman findfont
14 scalefont setfont    
SpaceMod h (This line with single font is justified) widthshow

しかし、この方法を異なるフォントの行に使用するにはどうすればよいでしょうか? 簡単な例は、次のように行に太字の部分を含めることです。

/Times-Roman findfont
14 scalefont setfont    
X h (How to) widthshow

/Times-Roman-Bold findfont
14 scalefont setfont    
X h justify this line) widthshow

/Times-Roman findfont
14 scalefont setfont    
X h (with multi fonts) widthshow

問題は、行全体を取得する単一の文字列がないことですstringwidth。個々の文字列に基づいて計算する場合でも、SpaceMod をどのように計算/設定できますか?

それとも、マルチフォントで行を揃えるために別のアプローチを使用する必要がありますか?

4

1 に答える 1