Article View: news.software.readers
Article #230932No one font can print everything.
From: Jeff▲Relf
Date: Wed, 04 Mar 2009 04:55
Date: Wed, 04 Mar 2009 04:55
42 lines
2569 bytes
2569 bytes
Although the DejaVu Sans Mono font is Very comprehensive,
no one font can print everything.
JeffRelf.F-M.FM/X.EXE does it as shown below.
When the screen reSizes ( or first comes up ):
gFont( DejaVu, L"DejaVu Sans Mono", CharH );
gFont( Consolas, L"Consolas", CharH );
gFont( Courier, L"Courier New", CharH );
gFont( Mincho, L"MS Mincho", _CharH(128./256) );
.......
#include <GDIPlus.H>
#pragma comment( lib, "GDIPlus.LIB")
using namespace Gdiplus;
.......
gFont( HFONT &F, LnP N, int H ) {
// “ FontFamily ” is a <GDIPlus.H> thing.
FontFamily Nym( N );
if ( ! Nym.IsAvailable() )
// Font is not installed, leave it NULL.
return ;
DeleteObject( F );
F = CreateFont( H, 0,0,0,0,0,0,0,0,0,0,0, FIXED_PITCH, N ); }
When caching a glyph ( to a DirectDraw surface ):
#define Try( F ) \
if ( F ) { \
/* Font exists, see if it has our glyph */ \
SetPtr( DC, F ); \
GetGlyphIndices( \
DC, B, 1, pUShort( & Good ), GGI_MARK_NONEXISTING_GLYPHS ); \
if ( Good != -1 ) goto HaveGlyph ; }
...........
// Find a glyph in these fonts, in this order.
Try( DejaVu ) Try( Consolas ) Try( Courier ) Try( Mincho )
// Can't cache the glyph, give up.
Chk( TheCache->ReleaseDC( DC ) ); return 1 ;
HaveGlyph:
// Cache the glyph.
.....
Technical Details
Message-ID:
<Jeff_Relf@Seattle.2009_Mar.3|8.55pm|d>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<Jeff_Relf@Seattle.2009_Mar.3|1.35pm|A> <20090304075821@usenet.piggo.com> <5dogd7wbpugq$.13bvtmlaongcn$.dlg@40tude.net> <1uyh1mlbm8e1c.dlg@deepthought.ena.si> <1xlquypaq2h5s.dlg@justacineast.motzarella.org> <17z389aste7yg.1dgzyghnoe1qj$.dlg@40tude.net>Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Mar.3|8.55pm|d> Subject: No one font can print everything. Date: Wed, 04 Mar 2009 04:55:37 +0000 From: Jeff▲Relf <Jeff_Relf@Seattle.TEST> References: <Jeff_Relf@Seattle.2009_Mar.3|1.35pm|A> <20090304075821@usenet.piggo.com> <5dogd7wbpugq$.13bvtmlaongcn$.dlg@40tude.net> <1uyh1mlbm8e1c.dlg@deepthought.ena.si> <1xlquypaq2h5s.dlg@justacineast.motzarella.org> <17z389aste7yg.1dgzyghnoe1qj$.dlg@40tude.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Newsgroups: news.software.readers Lines: 42 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net rgmgmlFhBTC33VLr/iRPigBAOvO7iP2h7ju9rgbVtvzmQ1YRnk Cancel-Lock: sha1:5BRRQpWQODr2lQWrdz498Dqdjts= User-Agent: JeffRelf.F-M.FM/X.ZIP X-Original-Bytes: 2346