Top / X Series / X3 - Reunion / 日本語化 / 参考資料

X Series/X3 - Reunion/日本語化/参考資料

ビットマップフォント仕様参考

fontmaker.exe
XBOXのフォント製作ツール
↑のfontbundle.rar の中にある fontmaker.exe でTTFファイルからTGAとABCファイルが作成出来た。
作り方は fontmaker.exe を起動
FileメニューのNewFont...で好きなフォントを選ぶ。(サイズは 9 位で)
Glyphs の From を 32 To を 41000
Texture properties の Size ボタンを押して Texture Size を 2048 2048 にしてOKボタン
Texture properties の Size ボタンを押して Texture Size を 4096 2048 にしてOKボタン
エラーが出るのでキャンセルする。(何故か上限の2048以上でBitmap展開される)
あとはFileメニューのSaveFontFilesで TGAとABCファイルが保存されます。 

fontmaker.exeのソースのようです。.abcファイルの構造の参考になれば。 http://forums.xbox-scene.com/lofiversion/index.php/t157569.html

こちらも参考に。 http://www.geocities.com/foetsch/bmpfonts/bmpfonts.htm http://www.geocities.com/foetsch/bmpfonts/DDFontEngine.zip

--Start file fontmaker.cpp
#define STRICT
#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <commdlg.h> // To get to the common font dialog
#include "resource.h" // To override the common font dialog

// Note: In case you plan to modify the dialog in this app's .rc file, keep in
// mind that the common font dialog uses pre-determined constants for it's
// controls.




//-----------------------------------------------------------------------------
// Name: struct GLYPH_ATTR
// Desc: A structure to hold attributes for one glpyh. The left, right, etc.
// values are texture coordinate offsets into the resulting texture image
// (which ends up in the .tga file). The offset, width, etc. values are
// spacing information, used when rendering the font.
//-----------------------------------------------------------------------------
struct GLYPH_ATTR
{
FLOAT left, top, right, bottom;
SHORT wOffset;
SHORT wWidth;
SHORT wAdvance;
};




//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
TCHAR g_strFontName[512]; // Font properties
DWORD g_dwFontHeight;
DWORD g_dwFontEffectiveHeight;
DWORD g_dwFontWeight = 400; // Default value of 400 = normal weight
BOOL g_bItalicized = 0; // Default value of FALSE = not-italicized

WCHAR g_dwStartGlyph = 0; // Range of glyphs to render
WCHAR g_dwEndGlyph = 0;
DWORD g_dwNumGlyphs = 0;

DWORD g_dwVersion = 0x00000004; // Texture file properties
DWORD g_dwTexWidth = 64; // Default texture dimensions
DWORD g_dwTexHeight = 64;
DWORD g_dwTexBPP = 16;

-- End File fontmaker.cpp
--Start File resource.h
#define IDD_FONTMAKER 1543
#define IDC_FONT 1136
#define IDC_GLYPHRANGE_START 9004
#define IDC_GLYPHRANGE_END 9005
#define IDC_STATIC -1
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

--End File resource.h
--Start File fontmaker.rc
//MS Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "dlgs.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_FONTMAKER DIALOG DISCARDABLE 13, 54, 263, 146
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "XBFontMaker"
FONT 8, "MS Shell Dlg"
BEGIN
COMBOBOX IDC_FONT,5,15,98,76,CBS_SIMPLE | CBS_OWNERDRAWFIXED |
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS |
CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "&Font:",1088,5,5,40,9
COMBOBOX 1137,110,15,62,76,CBS_SIMPLE | CBS_DISABLENOSCROLL |
WS_VSCROLL | WS_TABSTOP
LTEXT "Font st&yle:",1089,110,5,44,9
COMBOBOX 1138,175,15,27,76,CBS_SIMPLE | CBS_OWNERDRAWFIXED |
CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
WS_VSCROLL | WS_TABSTOP
LTEXT "&Size:",1090,175,5,30,9
EDITTEXT IDC_GLYPHRANGE_START,40,100,40,14,ES_AUTOHSCROLL |
ES_NUMBER
LTEXT "Start:",IDC_STATIC,10,100,25,15,SS_CENTERIMAGE
EDITTEXT IDC_GLYPHRANGE_END,40,120,40,14,ES_AUTOHSCROLL |
ES_NUMBER
LTEXT "End:",IDC_STATIC,10,120,25,15,SS_CENTERIMAGE
GROUPBOX "Glyph range",IDC_STATIC,5,90,100,50
CTEXT "AaBbYyZz",1092,115,100,80,35,SS_NOPREFIX | NOT
WS_VISIBLE
GROUPBOX "Sample",1073,110,90,95,50,WS_GROUP
DEFPUSHBUTTON "OK",IDOK,210,5,45,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,210,25,45,14,WS_GROUP
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h&#65533;"
END

2 TEXTINCLUDE DISCARDABLE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLSrn"
"#include ""windows.h""rn"
"#undef APSTUDIO_HIDDEN_SYMBOLSrn"
"#include ""dlgs.h""rn"
""
END

3 TEXTINCLUDE DISCARDABLE
BEGIN
"rn"
""
END

#endif // APSTUDIO_INVOKED

#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

--End File fontmaker.rc
NOTE: I haven't included the project file so just open up notepad and save the three above files then
compile with Visual C++ 6 or 7.

Today: 1, Yesterday: 0, Total: &counter([total|today|yesterday]); (since 11/13/2007)



Last-modified: 2009-09-14 (月) 00:11:59 (3919d)