add Export Stroke Templates option
This commit is contained in:
@@ -171,6 +171,7 @@ BEGIN
|
||||
POPUP "Options"
|
||||
BEGIN
|
||||
MENUITEM "Double Resolution", ID_OPTIONS_DOUBLERES
|
||||
MENUITEM "Export Stroke Templates", ID_OPTIONS_EXPORTSTROKETEMPLATES
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ BEGIN_MESSAGE_MAP(CTextureFontGeneratorDlg, CDialog)
|
||||
ON_COMMAND(ID_ACCELERATOR_ITALIC, OnStyleItalic)
|
||||
ON_COMMAND(ID_ACCELERATOR_BOLD, OnStyleBold)
|
||||
ON_COMMAND(ID_OPTIONS_DOUBLERES, &CTextureFontGeneratorDlg::OnOptionsDoubleres)
|
||||
ON_COMMAND(ID_OPTIONS_EXPORTSTROKETEMPLATES, &CTextureFontGeneratorDlg::OnOptionsExportstroketemplates)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -158,7 +159,6 @@ void CTextureFontGeneratorDlg::UpdateFont( bool bSavingDoubleRes )
|
||||
if( wc != 0xFFFF )
|
||||
desc.chars.push_back(wc);
|
||||
}
|
||||
|
||||
g_pTextureFont->m_PagesToGenerate.push_back( desc );
|
||||
|
||||
desc.name = "numbers";
|
||||
@@ -169,9 +169,25 @@ void CTextureFontGeneratorDlg::UpdateFont( bool bSavingDoubleRes )
|
||||
if( wc != 0xFFFF )
|
||||
desc.chars.push_back(wc);
|
||||
}
|
||||
|
||||
g_pTextureFont->m_PagesToGenerate.push_back( desc );
|
||||
|
||||
|
||||
//
|
||||
// Save duplicate imnages of each page with "-stroke" appended to the page name.
|
||||
//
|
||||
bool bExportStrokeTemplates = !!( pMenu->GetMenuState(ID_OPTIONS_EXPORTSTROKETEMPLATES, 0) & MF_CHECKED );
|
||||
if( bExportStrokeTemplates )
|
||||
{
|
||||
int iNumPages = (int)g_pTextureFont->m_PagesToGenerate.size();
|
||||
for( int i=0; i<iNumPages; i++ )
|
||||
{
|
||||
FontPageDescription desc = g_pTextureFont->m_PagesToGenerate[i];
|
||||
desc.name += "-stroke";
|
||||
g_pTextureFont->m_PagesToGenerate.push_back( desc );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Go: */
|
||||
g_pTextureFont->FormatFontPages();
|
||||
|
||||
@@ -512,6 +528,14 @@ void CTextureFontGeneratorDlg::OnOptionsDoubleres()
|
||||
Invalidate( FALSE );
|
||||
}
|
||||
|
||||
void CTextureFontGeneratorDlg::OnOptionsExportstroketemplates()
|
||||
{
|
||||
CMenu *pMenu = GetMenu();
|
||||
int Checked = pMenu->GetMenuState(ID_OPTIONS_EXPORTSTROKETEMPLATES, 0) & MF_CHECKED;
|
||||
Checked ^= MF_CHECKED;
|
||||
pMenu->CheckMenuItem( ID_OPTIONS_EXPORTSTROKETEMPLATES, Checked );
|
||||
}
|
||||
|
||||
void CTextureFontGeneratorDlg::OnDeltaposSpinTop(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
{
|
||||
LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
|
||||
@@ -585,7 +609,8 @@ void CTextureFontGeneratorDlg::OnFileSave()
|
||||
*/
|
||||
|
||||
CMenu *pMenu = GetMenu();
|
||||
if( !!( pMenu->GetMenuState(ID_OPTIONS_DOUBLERES, 0) & MF_CHECKED ) ) // DoubleRes checked?
|
||||
bool bDoubleRes = !!( pMenu->GetMenuState(ID_OPTIONS_DOUBLERES, 0) & MF_CHECKED );
|
||||
if( bDoubleRes )
|
||||
{
|
||||
g_pTextureFont->Save( szFile, "", true, false ); // save metrics
|
||||
UpdateFont( true ); // generate DoubleRes bitmaps
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
CSpinButtonCtrl m_SpinBaseline;
|
||||
CStatic m_FontType;
|
||||
afx_msg void OnOptionsDoubleres();
|
||||
afx_msg void OnOptionsExportstroketemplates();
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
#define IDC_CHECK1 1026
|
||||
#define ID_ACCELERATOR_ITALIC 32773
|
||||
#define ID_ACCELERATOR_BOLD 32774
|
||||
#define ID_OPTIONS_DOUBLERESOLUTION 32779
|
||||
#define ID_OPTIONS_DOUBLERES 32780
|
||||
#define IDC_OPTIONS_DOUBLERES 32781
|
||||
#define ID_OPTIONS_EXPORTSTROKETEMPLATES 32782
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 145
|
||||
#define _APS_NEXT_COMMAND_VALUE 32782
|
||||
#define _APS_NEXT_COMMAND_VALUE 32783
|
||||
#define _APS_NEXT_CONTROL_VALUE 1028
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user