|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionThis article describes the implementation of a font chooser dialog for the Pocket PC, with the following features:
The dialog layout was based on Pocket Excel's, and allows you to use the dialog with the SIP up. ImplementationThe dialog was implemented as a property page so you can use it in your own property sheets without change. The demo project uses my own CCePropertySheet class to encapsulate it. The class uses two public members for interfacing with the user:
Font enumerationFont families are enumerated through a call to ClearTypeClearType support depends on your system supporting it. Please check with your vendor if your device supports ClearType. Creating a font with the ClearType property is as simple as specifying 5 as the Using the dialogUsing the dialog is very straightforward: void CChildView::OnChooseFont() { CCePropertySheet sheet(_T("Choose Font")); CChooseFontPage page; // // Create the default font // page.m_logFont.lfHeight = -11; page.m_logFont.lfWidth = 0; page.m_logFont.lfEscapement = 0; page.m_logFont.lfOrientation = 0; page.m_logFont.lfWeight = FW_NORMAL; page.m_logFont.lfItalic = FALSE; page.m_logFont.lfUnderline = FALSE; page.m_logFont.lfStrikeOut = 0; page.m_logFont.lfCharSet = ANSI_CHARSET; page.m_logFont.lfOutPrecision = OUT_DEFAULT_PRECIS; page.m_logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; page.m_logFont.lfQuality = DEFAULT_QUALITY; page.m_logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS; _tcscpy(page.m_logFont.lfFaceName, TEXT("Tahoma")); sheet.AddPage(&page); sheet.DoModal(); } On exit, the Adding new fontsAdding new fonts to your device is simple: just copy the desktop TrueType font files you wish to the device's \Windows\Fonts folder. They will be readily available.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||