PC_PRINTER_GET_FONT

プリンタのフォントを取得する。

構文:
call "PC_PRINTER_GET_FONT" using     printer-handle
                                      font-family-name
                                      font-size
                                      font-style
                            returning status-code
パラメタ:
呼び出しプロトタイプ使用時 (  説明の読み方) PIC (32ビットシステム)
printer-handle cblt-x4-comp5 pic x(4) comp-5.
font-family-name 以下を含むcblt-printer-nameとして事前定義された集団: 以下を含む集団項目:
  cblte-pn-name-len   cblt-x2-comp5   pic x(2) comp-5.
  cblte-pn-name   pic x(n).   pic x(n).
font-size cblt-x2-comp5 pic x(2) comp-5.
font-style cblt-x2-comp5 pic x(2) comp-5.
status-code  説明の読み方参照
入力パラメタ:
printer-handle プリンタが開かれているとき返されるプリンタハンドル
cblte-pn-name-len フォントファミリー名のバッファの長さ
出力パラメタ:
name-len フォントファミリー名のバッファの長さ。長さが0の場合は、フォントは返されずに、オペレーティングシステムのデフォルトが使用される(フォントサイズとスタイルは無効)。
name-text 使用されるフォントファミリー名(クーリエ、ヘルベチカ、タイムズ等)
font-size フォントのポイントサイズ
font-style フォントスタイルセット
3 太字(ボールド)
2 打ち消し線(ストライクアウト)
1 下線(アンダーライン)
0 斜体(イタリック)

残りのビットはすべて今後の使用のために確保される。

例:
 working-storage section.
 01.
   03 document-title.
     05 title-len           pic x(2) comp-5.
     05 title-text          pic x(20).

   03 font-family.
     05 font-family-namelen  pic x(2) comp-5 value 80.
     05 font-family-name     pic x(80).

   03 font-size              pic x(4) comp-5.
   03 font-style             pic x(4) comp-5.

   03 abort                  pic x(4) comp-5 value 1.
   03 control                pic x(4) comp-5 value 2.
   03 flags                  pic x(4) comp-5 value 3.
   03 handle                 pic x(4) comp-5.

 procedure division.
     move 17 to title-len
     move "Printer Info Test" to title-text

     call "PC_PRINTER_OPEN" using by reference handle
                                  by reference document-title
                                  by value flags
                                  by value 0
     end-call

     if return-code = zero
         call "PC_PRINTER_GET_FONT"
                               using by reference handle
                                     by reference font-family
                                     by reference font-size
                                     by reference font-style
         end-call
         if return-code equal zero
             if font-size equal zero
                 display "Current Font   : no font selected"
             else
                 display "Current Font   : "
                       font-family-name(1:font-family-namelen)
                 display "Font size      : " font-size
                 display "Raw Font Style : " font-style
             end-if
         else
             display "PC_PRINTER_GET_FONT failed"
         end-if
     end-if

     perform close-down-printer
     .

 close-down-printer section.
     call "PC_PRINTER_CONTROL" using by reference handle
                                     by value abort
     end-call

     call "PC_PRINTER_CLOSE" using by reference handle
     end-call
     .