// PreFont.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "resource.h"		// For IDD_DLG_SJIS_FONT_SELECT.
#include "RegData.h"		// For g_pReg->SetRegFont.
#include "UtilWin.h"		// For EnumWinTitle,FFAddString,etc.
#include "UtilStr.h"		// For GetResWString.
#include "UtilDlg.h"		// For SetUnitString.etc.
#include "UtilCoord.h"		// For pnt2mm.etc.
#include "UtilMath.h"		// For dbpt2str.
#include "DlgFontSelect.h"	// For CFCDlgFontSelect.
#include "PreFont.h"		// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFCPreFont _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfH_xHqqkZx_

IMPLEMENT_DYNCREATE(CFCPreFont, CFCPropertyPageBase)

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::CFCPreFont
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDhEiDeIiDiLiDgHiDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.02.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCPreFont::CFCPreFont () : BASE_CLASS(CFCPreFont::IDD)
{
	//{{AFX_DATA_INIT(CFCPreFont)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDiBiDjDiDgPiCmMiPiJiKpKiJlLiPiIjHjNiCpAjCmHiJmBiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_INIT
} // CFCPreFont::CFCPreFont.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::~CFCPreFont
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.02.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCPreFont::~CFCPreFont ()
{
} // CFCPreFont::~CFCPreFont.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::DoDataExchange
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_ _xZkqqHx_iDgGiBfLiDfOiCmMiMpAiKlHiCmGjHeMiMpIjAkLiDgAiDeGiDgCiDeOiCmMiClNiCnPiCmJiDhEiDiMiBfLiDiAiDiPiBfLiDeOiCkK_xHqqkZx_
 *			_xZkqqHx_iMmEiCnBiPgPiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.02.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::DoDataExchange (CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCPreFont)
	DDX_Control(pDX, IDC_CEV_CMB_FNT_ITEM_NAME, m_cmbFntItemName);
	DDX_Control(pDX, IDC_CEV_STC_FNT_SAMPLE, m_stcFontSample);
	//}}AFX_DATA_MAP
} // CFCPreFont::DoDataExchange.

BEGIN_MESSAGE_MAP(CFCPreFont, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCPreFont)
	ON_CBN_SELCHANGE(IDC_CEV_CMB_FNT_ITEM_NAME, OnSelchangeCevCmbFntItemName)
	ON_BN_CLICKED(IDC_CEV_RDO_FNT_AUTO, OnCevRdoFntAuto)
	ON_BN_CLICKED(IDC_CEV_RDO_FNT_SPEC, OnCevRdoFntSpec)
	ON_BN_CLICKED(IDC_CEV_BTN_FNT_SET, OnCevBtnFntSet)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCPreFont _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::SetGlobalFont
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCpAiBeBiKmCiLkLiDhEiDeIiDjDiDgHiCmMiDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJjAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFmPjAjEiCkKiCfAiCmCiCmFiCoAjFmPiNfIiClDiCoKiCmEiCkCiCoKiCmO_xHqqkZx_ TRUE_xZkqqHx_iBeBiClLiCkEiCmFiCmIiCkPiCoKiCmO_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_jDoAjFjEjHhAiBeC_xHqqkZx_OnOK_xZkqqHx_iCmFiOgHjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCPreFont::SetGlobalFont () const
{
	BOOL bIsChanged = FALSE;
	for (int iC = 0; iC < FDFT_END; iC++)
	{
		// _xZkqqHx_iKmCiLkLjHhAiDePiDiNiBfLiDgPiDiLjFmPjAjEiCnGjAnNjCoIiBeC_xHqqkZx_
		g_pReg->SetRegFont(iC, m_tlfEnvFonts[iC]);
		// _xZkqqHx_jFmPjAjEiCkKjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
		if (m_tlfEnvFonts[iC].IsChanged()) bIsChanged = TRUE;
	}
	return bIsChanged;
} // CFCPreFont::SetGlobalFont.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::UpdateModified
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiPeDjAlDiDhEiDiJiDePiCmMiPpDjBnEiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iKgFiDiBiDjDiDgPjFmPjAjEiCpAjClCiCnHiBeBiPeDjAlDiClDiCoKiCmEiCkCiCoKiCmOiPeDjAlDiDhEiDiJiDePiCpAjAnNjCoIiBeC_xHqqkZx_
 *			_xZkqqHx_jDoAjFjEjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::UpdateModified ()
{
	BOOL bIsChanged = FALSE;
	int iC;
	for (iC = 0; !bIsChanged && iC < FDFT_END; iC++)
		if (m_tlfEnvFonts[iC].IsChanged()) bIsChanged = TRUE;
	SetModified(bIsChanged);
} // CFCPreFont::UpdateModified.

/////////////////////////////////////////////////////////////////////////////
// CFCPreFont _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiPiJiKpKiJlLiBeCiDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiClHiCoJiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeB_xHqqkZx_TRUE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.02.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCPreFont::OnInitDialog () 
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnInitDialog();
	// _xZkqqHx_iDgGiBfLiDfOiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
	m_cmbFntItemName.ResetContent();
	int iC;
	for (iC = 0; iC < FDFT_END; iC++)
	{
		// _xZkqqHx_iKmCiLkLiDhEiDeIiDjDiDgHiCpAiDiNiBfLiDeKiDiLjFmPjAjEiCnGjAnNjCoIiBeC_xHqqkZx_
		m_tlfEnvFonts[iC].Init(g_pReg->GetRegFontRec(iC).fciSpecFont);

		if (g_pReg->GetRegFontRec(iC).nWhich & (g_->appMode & FD_APPMODE_MASK))
		{
			// _xZkqqHx_iKmCiLkLiDhEiDeIiDjDiDgHjGlMiCpAiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCnGjAnNjCoIiBeC_xHqqkZx_
			int iSel = FFAddString(&m_cmbFntItemName ,
							GetResWString(g_pReg->GetRegFontRec(iC).dwDispName));
			// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDeDiDjDiDgGiDgCiDeOiDfIiCpAjAnNjCoIiBeC_xHqqkZx_
			m_cmbFntItemName.SetItemData(iSel, DWORD(iC));
		}
	}
	// _xZkqqHx_iMlLiNnNiCmMjBeJjBpA_xHqqkZx_Index_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
	m_cmbFntItemName.SetCurSel(0);
	// iFntItemName_xZkqqHx_jAnNjCoIiCpAiDiJiDfHiDeJiDhLiDfOiDjDiCmJjElNiJgGiClDiClJiCoJiBeC_xHqqkZx_
	OnSelchangeCevCmbFntItemName();
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMjCfAiImKjFfMiOkGiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	::SetUnitString(m_hWnd);
	// _xZkqqHx_jHjIiCkLjIhCjBmOiJjOjFlGiOjKjHpBiCmMjAnNjCoIiCpAiNhDiCkEiBeC_xHqqkZx_
	::RightByLeftHand(m_hWnd);

	return TRUE;  // _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeBjGnPiCoIjCgMiCmN_xHqqkZx_ TRUE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
	              // _xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
} // CFCPreFont::OnInitDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiBeFjDeLjHhAiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.02.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::OnOK () 
{
	// _xZkqqHx_iKmCiLkLiDhEiDeIiDjDiDgHiCmMiDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJjAnNjCoIiBeC_xHqqkZx_
	if (SetGlobalFont())
	{
		// _xZkqqHx_iDhEiDeIiDjDiDgHiPoOjFpBiCpAiDiMiDfHiDfIiDgHiDiKiCmJiPjBiCkLiNjOiCnOiBeC_xHqqkZx_
		g_pReg->SaveRegFont();
		// _xZkqqHx_jDkPiClGiDeBiDhGiDiKiCmMiDeFiDeCiDjDiDgIiDeFjHpBiLjDiBeC_xHqqkZx_
		FCWinTitleRecVector vWinTtl;
		::EnumWinTitle(vWinTtl);
		FCWinTitleRecVector::iterator iWin;
		for (iWin = vWinTtl.begin(); iWin != vWinTtl.end(); iWin++)
		{
			// WM_USER_REGFONT_CHANGED_xZkqqHx_iCpAjBjHjAeNiBeCiDhEiDeIiDjDiDgHiCpAjDmHiCnNjClMiClHiBeC_xHqqkZx_
			::PostMessage((*iWin).hwndApp, WM_USER_REGFONT_CHANGED, 0, 0);
		}
	}
	//----- _xZkqqHx_iKgFjBkOjAkLiCpAiPiJiKpKiJlL_xHqqkZx_ -----
	int iC;
	for (iC = 0; iC < FDFT_END; iC++)
		m_tlfEnvFonts[iC].Init();
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnOK();
} // CFCPreFont::OnOK.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnSelchangeCevCmbFntItemName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAnNjCoIjBmOiPnLiCmMiDhEiDeIiDjDiDgHjGlMiBgJiDfCiDjDiDhLiDhLiDgCiDeOiDfIiBgKiCkKjFmPiNfIiClDiCoKiClNiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::OnSelchangeCevCmbFntItemName ()
{
	// _xZkqqHx_iMlLiNnNiCmMjBeJjBpA_xHqqkZx_Index_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	int iFntItemName = int(m_cmbFntItemName.GetItemData(m_cmbFntItemName.GetCurSel()));

	// _xZkqqHx_jFfHiPiAiCmMjAnNjCoIiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
	if (m_tlfEnvFonts[iFntItemName].Get().mmHeight == 0.0)
	//----- _xZkqqHx_jFfHiPiAiCmMjAnNjCoIiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiJiDfHiDeJiDhLiDfOiDjDiCpAjDeLjAnIiCmIiPpDjBnEiCmJjAnNjCoIiBeC_xHqqkZx_
		CheckDlgButton(IDC_CEV_RDO_FNT_AUTO, TRUE);
		CheckDlgButton(IDC_CEV_RDO_FNT_SPEC, FALSE);
		// _xZkqqHx_iDfEiDjDiDhGiDiLjAnNjCoIiCmMiInHiBeBiDiJiDfHiDeJiDhLiDfOiDjDiCmMiDeDiDhIiDjDiDgHiDgOiDjDiDgIiDiJiCpAiOmAiNhDiBeC_xHqqkZx_
		OnCevRdoFntAuto();
	} else
	//----- _xZkqqHx_iOgHiCkCiClNiCkCiDhEiDeIiDjDiDgHiCpAiOhHjCoIiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiJiDfHiDeJiDhLiDfOiDjDiCpAjDeLjAnIiCmIiPpDjBnEiCmJjAnNjCoIiBeC_xHqqkZx_
		CheckDlgButton(IDC_CEV_RDO_FNT_AUTO, FALSE);
		CheckDlgButton(IDC_CEV_RDO_FNT_SPEC, TRUE);
		// _xZkqqHx_iDfEiDjDiDhGiDiLjAnNjCoIiCmMiInHiBeBiDiJiDfHiDeJiDhLiDfOiDjDiCmMiDeDiDhIiDjDiDgHiDgOiDjDiDgIiDiJiCpAiOmAiNhDiBeC_xHqqkZx_
		OnCevRdoFntSpec();
	}
} // CFCPreFont::OnSelchangeCevCmbFntItemName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnCevRdoFntAuto
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiJiDfHiDeJiDhLiDfOiDjDiBhFjFfHiPiAiCmMjAnNjCoIiBhGiCkKiJjPiClDiCoKiClNiCmGiCkLiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::OnCevRdoFntAuto ()
{
	// _xZkqqHx_iBhFiDhEiDeIiDjDiDgHiCmMjAnNjCoIiBhGiDhLiDfOiDjDiCpAjGlDiMpIiPpDjBnEiCmJiBeC_xHqqkZx_
	GetDlgItem(IDC_CEV_BTN_FNT_SET)->EnableWindow(FALSE);
	// _xZkqqHx_iMlLiNnNiCmMjBeJjBpA_xHqqkZx_Index_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	int iFntItemName = int(m_cmbFntItemName.GetItemData(m_cmbFntItemName.GetCurSel()));
	// _xZkqqHx_iDhEiDeIiDjDiDgHiCmMiDiBiDjDiDgPjFmPjAjEiCmJiBeBjIeBjDkOiPpDjBnEiCpAiOkGiClHiCePiCpAjAnNjCoIiBeC_xHqqkZx_
//----- 06.05.22 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	const FCFontCharInfo nulFont = { 0 };
//----- 06.05.22 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// memset _xZkqqHx_iCmFiPiJiKpKiJlLiClHiCoJiClBiCmGiBeC_xHqqkZx_ = {0} _xZkqqHx_iCmFiCmNiCkEiCnMiCkNiPiJiKpKiJlLiCmFiCkLiCmIiCkCiPoKiNiHiCkKiCkAiCmBiClNiBeC_xHqqkZx_
	FCFontCharInfo nulFont;
	memset(&nulFont, 0, sizeof(nulFont));
//----- 06.05.22 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	m_tlfEnvFonts[iFntItemName] = nulFont;

	//----- _xZkqqHx_iDfEiDjDiDhGiDiLiDhEiDeIiDjDiDgHiCmMjFmPiNfIiPiIjHjN_xHqqkZx_ -----
	// _xZkqqHx_jAfGiClFiCkCiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
	FCFontCharInfo fci;
	FFCopy(fci, FFGetStdFont(
					g_pReg->GetRegFontRec(iFntItemName).dbptHeightDefault, 0),
			g_->dDisplayPPM);
	fci.mmHeight = pnt2mm(g_pReg->GetRegFontRec(iFntItemName).dbptHeightDefault);
	m_stcFontSample.SetFontCharInfo(fci);
	// _xZkqqHx_iDfEiDjDiDhGiDiLiCmMjFfMiOkGjFlGiOjKjHpBiCpAjAnNjCoIiBeC_xHqqkZx_
	wchar_t tcsBuff[200];
	dbpt2str(tcsBuff, fabs(g_pReg->GetRegFontRec(iFntItemName).dbptHeightDefault));
	WString strMsg;
	strMsg.Format(L"%s %s", fci.szFaceName, tcsBuff);
// 02.09.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)
//	FFSetWindowText(&m_stcFontSample, strMsg);
	m_stcFontSample.SetWindowTextW(strMsg);
	m_stcFontSample.Invalidate();

	// _xZkqqHx_iPeDjAlDiDhEiDiJiDePiCmMiPpDjBnEiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateModified();
} // CFCPreFont::OnCevRdoFntAuto.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnCevRdoFntSpec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiJiDfHiDeJiDhLiDfOiDjDiBhFiOgHiCkCiClNiCkCiDhEiDeIiDjDiDgHiCpAiOhHjCoIiBhGiCkKiJjPiClDiCoKiClNiCmGiCkLiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::OnCevRdoFntSpec ()
{
	// _xZkqqHx_iBhFiDhEiDeIiDjDiDgHiCmMjAnNjCoIiBhGiDhLiDfOiDjDiCpAjHeMiMpIiPpDjBnEiCmJiBeC_xHqqkZx_
	GetDlgItem(IDC_CEV_BTN_FNT_SET)->EnableWindow(TRUE);
	// _xZkqqHx_iMlLiNnNiCmMjBeJjBpA_xHqqkZx_Index_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	int iFntItemName = int(m_cmbFntItemName.GetItemData(m_cmbFntItemName.GetCurSel()));
	// _xZkqqHx_jFfHiPiAiCmMjAnNjCoIiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
	if (m_tlfEnvFonts[iFntItemName].Get().mmHeight == 0.0)
	{
		// _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCmJiDgGiDhEiDeIiDiLiDgHiCmMiDfGiDfIiDgFiDiAiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
		FCFontCharInfo fci;
		FFCopy(fci, FFGetStdFont(
						g_pReg->GetRegFontRec(iFntItemName).dbptHeightDefault, 0),
				g_->dDisplayPPM);
		fci.mmHeight = pnt2mm(g_pReg->GetRegFontRec(iFntItemName).dbptHeightDefault);
		m_tlfEnvFonts[iFntItemName] = fci;
	}
	//----- _xZkqqHx_iDfEiDjDiDhGiDiLiDhEiDeIiDjDiDgHiCmMjFmPiNfIiPiIjHjN_xHqqkZx_ -----
	// _xZkqqHx_jAfGiClFiCkCiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
	m_stcFontSample.SetFontCharInfo(m_tlfEnvFonts[iFntItemName]);
	// _xZkqqHx_iDfEiDjDiDhGiDiLiCmMjFfMiOkGjFlGiOjKjHpBiCpAjAnNjCoIiBeC_xHqqkZx_
	wchar_t tcsBuff[200];
	dbpt2str(tcsBuff, mm2pnt(fabs(m_tlfEnvFonts[iFntItemName].Get().mmHeight)));
	WString strMsg;
	strMsg.Format(L"%s %s", m_tlfEnvFonts[iFntItemName].Get().szFaceName, tcsBuff);
// 02.09.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)
//	FFSetWindowText(&m_stcFontSample, strMsg);
	m_stcFontSample.SetWindowTextW(strMsg);
	m_stcFontSample.Invalidate();

	// _xZkqqHx_iPeDjAlDiDhEiDiJiDePiCmMiPpDjBnEiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateModified();
} // CFCPreFont::OnCevRdoFntSpec.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPreFont::OnCevBtnFntSet
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFiDhEiDeIiDjDiDgHiCmMjAnNjCoIiBhGiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiCmGiCkLiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.28 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPreFont::OnCevBtnFntSet ()
{
	// _xZkqqHx_iMlLiNnNiCmMjBeJjBpA_xHqqkZx_Index_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	int iFntItemName = int(m_cmbFntItemName.GetItemData(m_cmbFntItemName.GetCurSel()));
	// _xZkqqHx_iDhEiDeIiDjDiDgHiDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiBeC_xHqqkZx_
//----- 01.02.07 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	LOGFONT logFont;
//	FFCopy(logFont, m_tlfEnvFonts[iFntItemName].Get(), g_->dDisplayPPM);
//	CFontDialog dlg(&logFont, CF_BOTH|CF_NOOEMFONTS|CF_SCALABLEONLY);
//	// _xZkqqHx_iDeMiDiDiDjDiDfKiDiLiDhLiDfOiDjDiCmIiCoHiCmOjFjMiLeBiBeC_xHqqkZx_
//	if (dlg.DoModal() != IDOK) return;
//	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCkJiCoHiDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeC_xHqqkZx_
//	FCFontCharInfo fci;
//	FFCopy(fci, logFont, g_->dDisplayPPM);
//	m_tlfEnvFonts[iFntItemName] = fci;
//----- 01.02.07 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDhEiDeIiDjDiDgHiDfPiDeDiDeBiDiNiDePiCpAiKmIiInFjFfMiOkGiClHiCoJiClNiCnPiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIjFhDiOgHjHhAiCmJjFmPiNfIiBeC_xHqqkZx_
	BOOL bIsUseStdFont = g_pReg->GetIsUseStdFont();
	g_pReg->SetIsUseStdFont(FALSE);
	// _xZkqqHx_iDhEiDeIiDjDiDgHiDfPiDeDiDeBiDiNiDePjFfMiOkGiBeC_xHqqkZx_
	CFCDlgFontSelect dlg(IDD_DLG_SJIS_FONT_SELECT);
	FCFontCharInfo fci = m_tlfEnvFonts[iFntItemName];
	dlg.SetExtCodeFontCharInfo(fci);
	dlg.SetStdCodeFontCharInfo(fci);
//----- 02.09.03 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)-----
//	// _xZkqqHx_jFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmMjAnNjCoIiCpAjGnPiClHiBeC_xHqqkZx_
//	g_pReg->SetIsUseStdFont(bIsUseStdFont);
//	// _xZkqqHx_iDeMiDiDiDjDiDfKiDiLiDhLiDfOiDjDiCmIiCoHiCmOjFjMiLeBiBeC_xHqqkZx_
//	if (dlg.DoModal() != IDOK) return;
//----- 02.09.03 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)-----
	// _xZkqqHx_iDeMiDiDiDjDiDfKiDiLiDhLiDfOiDjDiCmIiCoHiCmOjFjMiLeBiBeC_xHqqkZx_
	if (dlg.DoModal() != IDOK)
	{
		// _xZkqqHx_jFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmMjAnNjCoIiCpAjGnPiClHiBeC_xHqqkZx_
		g_pReg->SetIsUseStdFont(bIsUseStdFont);
		return;
	}
	// _xZkqqHx_jFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmMjAnNjCoIiCpAjGnPiClHiBeC_xHqqkZx_
	g_pReg->SetIsUseStdFont(bIsUseStdFont);
//----- 02.09.03 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)-----
	// _xZkqqHx_jFmPiNfIiClDiCoKiClNiDhEiDeIiDjDiDgHiCmMjAnNjCoIiBeCjFfHiPiAiKePiDhEiDeIiDjDiDgHiCpAiOgHiCoNiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
	fci |= dlg.GetExtCodeFontCharInfo();
	m_tlfEnvFonts[iFntItemName] = fci;
//----- 01.02.07 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDfEiDjDiDhGiDiLiDhEiDeIiDjDiDgHiCmMjFmPiNfIiPiIjHjN_xHqqkZx_ -----

	// _xZkqqHx_jAfGiClFiCkCiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
	m_stcFontSample.SetFontCharInfo(m_tlfEnvFonts[iFntItemName]);
	// _xZkqqHx_iDfEiDjDiDhGiDiLiCmMjFfMiOkGjFlGiOjKjHpBiCpAjAnNjCoIiBeC_xHqqkZx_
	wchar_t tcsBuff[200];
	dbpt2str(tcsBuff, mm2pnt(fabs(m_tlfEnvFonts[iFntItemName].Get().mmHeight)));
	WString strMsg;
	strMsg.Format(L"%s %s", m_tlfEnvFonts[iFntItemName].Get().szFaceName, tcsBuff);
// 02.09.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ (_xZkqqHx_iDfEiDjDiDhGiDiLiCmJiBeBjFfHiPiAjFlGiOjKiDfCiBfLiDgIiCmJiNiHiClJiClNjFlGiOjKiCpAjAnNjCoIiBeC_xHqqkZx_)
//	FFSetWindowText(&m_stcFontSample, strMsg);
	m_stcFontSample.SetWindowTextW(strMsg);
	m_stcFontSample.Invalidate();

	// _xZkqqHx_iPeDjAlDiDhEiDiJiDePiCmMiPpDjBnEiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateModified();
} // CFCPreFont::OnCevBtnFntSet.
