PC_PRINTER_GET_FONT

プリンターのフォントを取得します。
制約事項: このルーチンは現在、UNIX プラットフォームではサポートされていません。

構文:

call "PC_PRINTER_GET_FONT" using     printer-handle
                                      font-family-name
                                      font-size
                                      font-style
                            returning status-code

パラメーター

printer-handle
呼び出しプロトタイプ (「説明の読み方」を参照):cblt-x4-comp5
PIC:pic x(4) comp-5
font-family-name
cblt-printer-name として定義されている集団 (以下を含む)
01 cblt-printer-name       typedef.
  03 cblte-pn-name-length  cblt-x2-comp5. *> pic x(2) comp-5.
  03 cblte-pn-name         cblt-x1.       *> Occurs depending on
                                          *> cblte-pn-name-length.  pic x(n).
font-size
呼び出しプロトタイプ (「説明の読み方」を参照):cblt-x4-comp5
PIC:pic x(4) comp-5
font-style
呼び出しプロトタイプ (「説明の読み方」を参照):cblt-x4-comp5
PIC:pic x(4) comp-5
status-code
説明の読み方」を参照。

入力パラメーター:

printer-handle プリンターが開かれた場合に返されるプリンター ハンドル。
cblte-pn-name-len フォント ファミリ名のバッファーの長さ。

出力パラメーター:

printer-handle
プリンターが開かれた場合に返されるプリンター ハンドル。
cblte-pn-name-len
フォント ファミリ名のバッファーの長さ。
name-len
フォント ファミリ名のバッファーの長さ。長さがゼロの場合、フォントは返されません。オペレーティング システムのデフォルトが使用されます (font-size および font-style は無効になります)。
name-text
使用するフォントのファミリ名 (Courier、Helvetica、Times など)。
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
     .