よろずやネット

最近はLibreofficeにハマっています。

斜体フォント CharPosture

… 前回の続き …

 

斜体フォントは、数値で指定する。
oSheet.getCellByPosition(0,0).CharPosture=1
とするようだ。

 

http://api.openoffice.org/docs/common/ref/com/sun/star/awt/FontSlant.html
上記には、フォントの斜体に関していろいろ説明があるのだが、具体的にどうやって設定するかが書いてない。
ページのタイトルが enum FontSlant となっていて、enumという単語から推測して、単純に整数を指定してみたら、うまくいった。(ラッキー!)
だから、これが正攻法かどうかはわからない。

 

斜体にするには、
oSheet.getCellByPosition(0,0).CharPosture=1
普通にするには、
oSheet.getCellByPosition(0,0).CharPosture=0
とする。

 

このプロパティにも、Asianな言語には、CharPostureAsian というのが用意されている。

 

oSheet.getCellByPosition(0,0).CharPosture=1
oSheet.getCellByPosition(0,0).CharPostureAsian=1

 

というように使う。

 

f:id:yorozuyanet:20190730120146g:plain

img_0

 

… 次回へ続く …