Example #1
0
static int CALLBACK FontEnumCallBack( LOGFONT * lplf, TEXTMETRIC * lpntm,
                                      DWORD dwFontType, LPVOID pArray )
{
   PHB_ITEM pSubItems = hb_itemArrayNew( 4 );

   HB_ARRAYSETSTR( pSubItems, 1, lplf->lfFaceName );
   hb_arraySetL( pSubItems, 2, ( lplf->lfPitchAndFamily & FIXED_PITCH ) != 0 );
   hb_arraySetL( pSubItems, 3, ( dwFontType & TRUETYPE_FONTTYPE ) != 0 );
   hb_arraySetNL( pSubItems, 4, lpntm->tmCharSet );
   hb_arrayAddForward( ( PHB_ITEM ) pArray, pSubItems );

   hb_itemRelease( pSubItems );

   return 1;
}
Example #2
0
PHB_ITEM wvg_logfontTOarray( LPLOGFONT lf, HB_BOOL bEmpty )
{
   PHB_ITEM aFont = hb_itemNew( NULL );

   hb_arrayNew( aFont, 15 );

   if( bEmpty )
   {
      hb_arraySetC( aFont, 1, NULL   );
      hb_arraySetNL( aFont, 2, 0     );
      hb_arraySetNL( aFont, 3, 0     );
      hb_arraySetNL( aFont, 4, 0     );
      hb_arraySetL(  aFont, 5, 0     );
      hb_arraySetL(  aFont, 6, 0     );
      hb_arraySetL(  aFont, 7, 0     );
      hb_arraySetNI( aFont, 8, 0     );
      hb_arraySetNI( aFont, 9, 0     );
      hb_arraySetNI( aFont, 10, 0    );
      hb_arraySetNI( aFont, 11, 0    );
      hb_arraySetNI( aFont, 12, 0    );
      hb_arraySetNI( aFont, 13, 0    );
      hb_arraySetNI( aFont, 14, 0    );
      hb_arraySetNInt( aFont, 15, 0  );
   }
   else
   {
      HB_ARRAYSETSTR( aFont, 1, lf->lfFaceName       );
      hb_arraySetNL( aFont, 2, lf->lfHeight          );
      hb_arraySetNL( aFont, 3, lf->lfWidth           );
      hb_arraySetNL( aFont, 4, lf->lfWeight          );
      hb_arraySetL(  aFont, 5, lf->lfItalic          );
      hb_arraySetL(  aFont, 6, lf->lfUnderline       );
      hb_arraySetL(  aFont, 7, lf->lfStrikeOut       );
      hb_arraySetNI( aFont, 8, lf->lfCharSet         );
      hb_arraySetNI( aFont, 9, lf->lfEscapement      );
      hb_arraySetNI( aFont, 10, lf->lfOrientation    );
      hb_arraySetNI( aFont, 11, lf->lfOutPrecision   );
      hb_arraySetNI( aFont, 12, lf->lfClipPrecision  );
      hb_arraySetNI( aFont, 13, lf->lfQuality        );
      hb_arraySetNI( aFont, 14, lf->lfPitchAndFamily );
   }

   return aFont;
}