diff --git a/GLFontGen.exe b/GLFontGen.exe new file mode 100644 index 0000000..26ccce2 Binary files /dev/null and b/GLFontGen.exe differ diff --git a/fontgen.aps b/fontgen.aps new file mode 100644 index 0000000..53b5760 Binary files /dev/null and b/fontgen.aps differ diff --git a/fontgen.cpp b/fontgen.cpp index e3ce496..773afc0 100644 --- a/fontgen.cpp +++ b/fontgen.cpp @@ -58,8 +58,8 @@ struct fontHeight_s { class glFontGenV2_c { public: void Init(const std::string_view fontName); - void Build(HDC dc); - void Finish(); + void Build(HDC dc, bool italic = false, bool bold = false); + void Finish(bool italic = false, bool bold = false); private: std::string fontName; @@ -75,7 +75,7 @@ void glFontGenV2_c::Init(const std::string_view i_fontName) std::filesystem::create_directories(outputDir, ec); } -void glFontGenV2_c::Build(HDC hdc) +void glFontGenV2_c::Build(HDC hdc, bool italic, bool bold) { // Get metrics TEXTMETRIC tm; @@ -112,21 +112,43 @@ void glFontGenV2_c::Build(HDC hdc) glyph.dat = std::make_unique(height * xs); memset(glyph.dat.get(), 0, height * xs); - // Copy glyph image - if (bbSize) { - const unsigned bbSpan = bbSize / ys; - for (unsigned y = 0; y < ys; y++) { - for (unsigned x = 0; x < xs; x++) { - glyph.dat[(y + yo) * xs + x] = (uint8_t)(bb[y * bbSpan + x] / 64.0 * 255.0); + // Copy glyph image + if (bbSize && ys > 0 && xs > 0) { + unsigned rowStride = ((xs + 3u) & ~3u); + if (rowStride == 0 || rowStride * ys > bbSize) { + rowStride = bbSize / ys; + } + if (rowStride == 0) { + rowStride = xs; + } + + for (unsigned y = 0; y < ys; y++) { + const int destRow = static_cast(y) + yo; + if (destRow < 0 || destRow >= static_cast(height)) { + continue; + } + + const size_t srcOffset = static_cast(y) * rowStride; + if (srcOffset + xs > bbSize) { + break; + } + const uint8_t* srcRow = bb.get() + srcOffset; + uint8_t* dstRow = glyph.dat.get() + static_cast(destRow) * xs; + + for (unsigned x = 0; x < xs; x++) { + const uint8_t raw = srcRow[x]; + float a = std::clamp(raw / 64.0f, 0.0f, 1.0f); + a = powf(a, 0.5f); + dstRow[x] = static_cast(a * 255.0f); + } } } } - } const unsigned cellHeight = height + cellPadding; // Find best image size - unsigned imgWidth, imgHeight; + unsigned imgWidth = 0, imgHeight = 0; unsigned bestDim = std::numeric_limits::max(); for (unsigned xmax = 32; xmax <= 2048; xmax <<= 1) { // Find number of rows for this width @@ -183,9 +205,12 @@ void glFontGenV2_c::Build(HDC hdc) } // Open image file for writing - std::ostringstream tgaName; - tgaName << fontName << "." << height << ".tga"; - const auto tgaPath = outputDir / tgaName.str(); + std::string tgaFileName = fontName; + if (italic) tgaFileName += " Italic"; + if (bold) tgaFileName += " Bold"; + tgaFileName += "." + std::to_string(height) + ".tga"; + + const auto tgaPath = outputDir / tgaFileName; std::ofstream out(tgaPath, std::ios_base::binary); if (!out) { return; @@ -204,19 +229,18 @@ void glFontGenV2_c::Build(HDC hdc) uint8_t hdr = 255; std::array packet; - const auto WritePacket = [&]() - { - WriteRaw(hdr); - if (hdr & 0x80) - WriteRaw(packet[0]); - else - out.write((const char*)packet.data(), 4 * (hdr + 1)); - }; - + const auto WritePacket = [&]() { + WriteRaw(hdr); + if (hdr & 0x80) + WriteRaw(packet[0]); + else + out.write((const char*)packet.data(), 4 * (hdr + 1)); + }; + // Write image for (int y = imgHeight - 1; y >= 0; y--) { hdr = 255; - uint32_t lastPix; + uint32_t lastPix = 0; const uint32_t* line_start = &image[y * imgWidth]; for (const auto* p = line_start; p < line_start + imgWidth; ++p) { if (hdr == 255) { @@ -277,10 +301,15 @@ void glFontGenV2_c::Build(HDC hdc) } } -void glFontGenV2_c::Finish() +void glFontGenV2_c::Finish(bool italic, bool bold) { // Open info file for writing - const auto tgfPath = outputDir / (fontName + ".tgf"); + std::string tgfFileName = fontName; + if (italic) tgfFileName += " Italic"; + if (bold) tgfFileName += " Bold"; + tgfFileName += ".tgf"; + + const auto tgfPath = outputDir / tgfFileName; std::ofstream tgf(tgfPath); if (!tgf) { return; @@ -291,8 +320,11 @@ void glFontGenV2_c::Finish() tgf << "HEIGHT " << height_data.height << ";\n"; for (size_t g = 0; g < height_data.glyphs.size(); g++) { const auto& glyph = height_data.glyphs[g]; - tgf << "GLYPH " << std::setw(3) << glyph.x << " " << std::setw(3) << glyph.y << " " << std::setw(2) << glyph.width << " " << std::setw(2) << glyph.spleft << " " << std::setw(2) << glyph.spright << ";\t// " << g; - if (isprint(g)) { + tgf << "GLYPH " << std::setw(3) << glyph.x << " " << std::setw(3) + << glyph.y << " " << std::setw(2) << glyph.width << " " + << std::setw(2) << glyph.spleft << " " << std::setw(2) + << glyph.spright << ";\t// " << g; + if (isprint((int)g)) { tgf << " (" << (char)g << ")"; } tgf << "\n"; @@ -306,25 +338,24 @@ void glFontGenV2_c::Finish() // Main Dialog Box // =============== -static void BuildFont(HDC hdc, char* fontName, int size, int fontWeight, int fontPitch, glFontGenV2_c& gen) +static void BuildFont(HDC hdc, char* fontName, int size, int fontWeight, int fontPitch, BOOL italic, BOOL bold, glFontGenV2_c& gen) { // Create font HFONT hf = CreateFont( - size, 0, 0, 0, - fontWeight, FALSE, FALSE, FALSE, - DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + size, 0, 0, 0, + bold ? FW_BOLD : fontWeight, italic, FALSE, FALSE, + DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, fontPitch | FF_MODERN, fontName ); if (hf == NULL) { return; } - // Select the font HGDIOBJ prevf = SelectObject(hdc, hf); // Run font generator - gen.Build(hdc); + gen.Build(hdc, italic, bold); // Delete font object SelectObject(hdc, prevf); @@ -334,8 +365,13 @@ static void BuildFont(HDC hdc, char* fontName, int size, int fontWeight, int fon static void BuildSelectedFonts(HWND hwndDlg) { // Get font name - char fontName[64]; - GetDlgItemText(hwndDlg, IDC_FONTSEL, fontName, 64); + char fontName[64] = {}; + HWND hList = GetDlgItem(hwndDlg, IDC_FONTSEL); + int sel = (int)SendMessage(hList, LB_GETCURSEL, 0, 0); + if (sel == LB_ERR) { + return; + } + SendMessage(hList, LB_GETTEXT, sel, (LPARAM)fontName); if (*fontName == 0) { return; } @@ -343,48 +379,131 @@ static void BuildSelectedFonts(HWND hwndDlg) // Get font attributes int fontWeight = GetDlgItemInt(hwndDlg, IDC_FONTWEIGHT, NULL, 0); int fontPitch = (Button_GetCheck(GetDlgItem(hwndDlg, IDC_FONTFIXED))) ? FIXED_PITCH : VARIABLE_PITCH; + BOOL italic = Button_GetCheck(GetDlgItem(hwndDlg, IDC_FONTITALIC)); + BOOL bold = Button_GetCheck(GetDlgItem(hwndDlg, IDC_FONTBOLD)); + + if (bold && fontWeight < FW_BOLD) + fontWeight = FW_BOLD; glFontGenV2_c gen; gen.Init(fontName); // Generate selected fonts HDC hdc = GetDC(hwndDlg); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ10))) BuildFont(hdc, fontName, 10, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ12))) BuildFont(hdc, fontName, 12, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ14))) BuildFont(hdc, fontName, 14, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ16))) BuildFont(hdc, fontName, 16, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ18))) BuildFont(hdc, fontName, 18, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ20))) BuildFont(hdc, fontName, 20, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ22))) BuildFont(hdc, fontName, 22, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ24))) BuildFont(hdc, fontName, 24, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ26))) BuildFont(hdc, fontName, 26, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ28))) BuildFont(hdc, fontName, 28, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ32))) BuildFont(hdc, fontName, 32, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ36))) BuildFont(hdc, fontName, 36, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ40))) BuildFont(hdc, fontName, 40, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ48))) BuildFont(hdc, fontName, 48, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ56))) BuildFont(hdc, fontName, 56, fontWeight, fontPitch, gen); - if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ64))) BuildFont(hdc, fontName, 64, fontWeight, fontPitch, gen); - - gen.Finish(); + + + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZALL))) { + const int allSizes[] = { 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 32, 36, 40, 48, 56, 64 }; + for (int size : allSizes) + BuildFont(hdc, fontName, size, fontWeight, fontPitch, italic, bold, gen); + } + else { + + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ10))) BuildFont(hdc, fontName, 10, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ12))) BuildFont(hdc, fontName, 12, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ14))) BuildFont(hdc, fontName, 14, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ16))) BuildFont(hdc, fontName, 16, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ18))) BuildFont(hdc, fontName, 18, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ20))) BuildFont(hdc, fontName, 20, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ22))) BuildFont(hdc, fontName, 22, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ24))) BuildFont(hdc, fontName, 24, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ26))) BuildFont(hdc, fontName, 26, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ28))) BuildFont(hdc, fontName, 28, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ32))) BuildFont(hdc, fontName, 32, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ36))) BuildFont(hdc, fontName, 36, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ40))) BuildFont(hdc, fontName, 40, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ48))) BuildFont(hdc, fontName, 48, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ56))) BuildFont(hdc, fontName, 56, fontWeight, fontPitch, italic, bold, gen); + if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SZ64))) BuildFont(hdc, fontName, 64, fontWeight, fontPitch, italic, bold, gen); + } + + gen.Finish(italic, bold); MessageBox(hwndDlg, "Font generated successfully.", "OpenGL Font Generator", MB_ICONINFORMATION); } -static int __stdcall EnumFontProc(const LOGFONT *lf, const TEXTMETRIC *ltm, unsigned long FontType, LPARAM lParam) +// EnumFontProc: add names to the LISTBOX instead of combo +static int __stdcall EnumFontProc(const LOGFONT* lf, const TEXTMETRIC* ltm, unsigned long FontType, LPARAM lParam) { - ComboBox_AddString((HWND)lParam, lf->lfFaceName); + HWND hList = (HWND)lParam; + // SendMessage will pick ANSI/UNICODE variant automatically + SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)lf->lfFaceName); return 1; } +static HFONT g_hPreviewFont = NULL; + +// Create or update the preview control font and text. +// Uses current selection, weight and italic settings to create a sample HFONT +static void UpdatePreview(HWND hwndDlg) +{ + // Get selected font name from listbox + char fontName[128] = {}; + HWND hList = GetDlgItem(hwndDlg, IDC_FONTSEL); + int sel = (int)SendMessageA(hList, LB_GETCURSEL, 0, 0); + if (sel == LB_ERR) return; + SendMessageA(hList, LB_GETTEXT, sel, (LPARAM)fontName); + if (fontName[0] == '\0') return; + + // Get preview text from edit control + char previewText[512] = {}; + GetDlgItemTextA(hwndDlg, IDC_PREVIEWTEXT, previewText, (int)std::size(previewText)); + if (previewText[0] == '\0') { + strcpy_s(previewText, "The quick brown fox jumps over the lazy dog"); + SetDlgItemTextA(hwndDlg, IDC_PREVIEWTEXT, previewText); + } + + // Get weight, italic, and bold + int fontWeight = GetDlgItemInt(hwndDlg, IDC_FONTWEIGHT, NULL, FALSE); + BOOL italic = Button_GetCheck(GetDlgItem(hwndDlg, IDC_FONTITALIC)); + BOOL bold = Button_GetCheck(GetDlgItem(hwndDlg, IDC_FONTBOLD)); + + // Choose a reasonable preview point size (you can change this) + const int previewPoint = 18; + + // Convert points -> device pixels and request character height + HDC hdc = GetDC(hwndDlg); + const int dpiY = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(hwndDlg, hdc); + const int lfHeight = -MulDiv(previewPoint, dpiY, 72); + + // Build LOGFONT + LOGFONTA lf; + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = lfHeight; + lf.lfWeight = bold ? FW_BOLD : ((fontWeight > 0) ? fontWeight : FW_NORMAL); + lf.lfItalic = italic ? 1 : 0; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfPitchAndFamily = FF_DONTCARE; + strncpy_s(lf.lfFaceName, fontName, _TRUNCATE); + + // Create HFONT + HFONT hNewFont = CreateFontIndirectA(&lf); + if (!hNewFont) return; + + // Apply to preview control + HWND hPreview = GetDlgItem(hwndDlg, IDC_PREVIEW); + // Set text first then font so control reports correct layout + SetWindowTextA(hPreview, previewText); + SendMessageA(hPreview, WM_SETFONT, (WPARAM)hNewFont, TRUE); + + // Destroy previous font + if (g_hPreviewFont) { + // safe to delete after setting new font (control now uses hNewFont) + DeleteObject(g_hPreviewFont); + } + g_hPreviewFont = hNewFont; +} + static int __stdcall DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CLOSE: + if (g_hPreviewFont) { DeleteObject(g_hPreviewFont); g_hPreviewFont = NULL; } EndDialog(hwndDlg, 1); break; - case WM_INITDIALOG: + case WM_INITDIALOG: // Add font weights ComboBox_AddString(GetDlgItem(hwndDlg, IDC_FONTWEIGHT), "100"); ComboBox_AddString(GetDlgItem(hwndDlg, IDC_FONTWEIGHT), "200"); @@ -400,7 +519,14 @@ static int __stdcall DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara // Add font names EnumFontFamilies(GetDC(hwndDlg), NULL, EnumFontProc, (LPARAM)GetDlgItem(hwndDlg, IDC_FONTSEL)); - ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_FONTSEL), 0); + ListBox_SetCurSel(GetDlgItem(hwndDlg, IDC_FONTSEL), 0); + + // Default preview text + SetDlgItemTextA(hwndDlg, IDC_PREVIEWTEXT, "Path of Exile 2"); + // Check the "All" box by default + CheckDlgButton(hwndDlg, IDC_SZALL, BST_CHECKED); + // Initialize preview + UpdatePreview(hwndDlg); break; @@ -410,21 +536,29 @@ static int __stdcall DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara BuildSelectedFonts(hwndDlg); break; case IDC_QUIT: + // cleanup preview font + if (g_hPreviewFont) { DeleteObject(g_hPreviewFont); g_hPreviewFont = NULL; } EndDialog(hwndDlg, 1); break; + case IDC_FONTSEL: + case IDC_FONTITALIC: + case IDC_FONTBOLD: + case IDC_FONTWEIGHT: + case IDC_PREVIEWTEXT: + if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == LBN_SELCHANGE || HIWORD(wParam) == EN_CHANGE) + UpdatePreview(hwndDlg); + break; } break; - } - return FALSE; + default: + return 0; + } + return 1; } -int __stdcall WinMain(HINSTANCE hinst, HINSTANCE hinstP, LPSTR CmdLine, int ShowCmd) +int __stdcall WinMain(HINSTANCE hInst, HINSTANCE, char*, int) { - INITCOMMONCONTROLSEX icce; - icce.dwSize = sizeof(INITCOMMONCONTROLSEX); - icce.dwICC = ICC_STANDARD_CLASSES; - InitCommonControlsEx(&icce); - - return (int)DialogBox(hinst, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc); + InitCommonControls(); + return DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_MAIN), 0, DlgProc, 0); } diff --git a/fontgen.rc b/fontgen.rc index b3bb2dc..5c65606 100644 --- a/fontgen.rc +++ b/fontgen.rc @@ -23,36 +23,41 @@ // Dialog // -IDD_MAIN DIALOGEX 0, 0, 191, 94 +IDD_MAIN DIALOGEX 0, 0, 460, 140 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU CAPTION "OpenGL Font Generator" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - PUSHBUTTON "Generate",IDC_GEN,71,71,50,14 - PUSHBUTTON "Quit",IDC_QUIT,134,71,50,14 - COMBOBOX IDC_FONTSEL,71,7,113,114,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - RTEXT "Weight:",IDC_STATIC,66,24,40,12,SS_CENTERIMAGE - COMBOBOX IDC_FONTWEIGHT,134,24,50,78,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Fixed Pitch:",IDC_FONTFIXED,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | BS_VCENTER | WS_TABSTOP,66,40,51,12 - CONTROL "10px",IDC_SZ10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,31,10 - CONTROL "12px",IDC_SZ12,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,17,31,10 - CONTROL "14px",IDC_SZ14,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,31,10 - CONTROL "16px",IDC_SZ16,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,37,31,10 - CONTROL "18px",IDC_SZ18,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,47,31,10 - CONTROL "20px",IDC_SZ20,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,57,31,10 - CONTROL "22px",IDC_SZ22,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,67,31,10 - CONTROL "24px",IDC_SZ24,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,77,31,10 - CONTROL "26px",IDC_SZ26,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,7,31,10 - CONTROL "28px",IDC_SZ28,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,17,31,10 - CONTROL "32px",IDC_SZ32,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,27,31,10 - CONTROL "36px",IDC_SZ36,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,37,31,10 - CONTROL "40px",IDC_SZ40,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,47,31,10 - CONTROL "48px",IDC_SZ48,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,57,31,10 - CONTROL "56px",IDC_SZ56,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,67,31,10 - CONTROL "64px",IDC_SZ64,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,77,31,10 + PUSHBUTTON "Generate", IDC_GEN, 81, 121, 50, 14 + PUSHBUTTON "Quit", IDC_QUIT, 144, 121, 50, 14 + LISTBOX IDC_FONTSEL, 81, 7, 120, 96, LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_BORDER + // Preview box (static) and editable preview text + CONTROL "", IDC_PREVIEW, "Static", SS_LEFT | WS_BORDER | WS_GROUP, 205, 7, 238, 72 + EDITTEXT IDC_PREVIEWTEXT, 205, 86, 238, 18, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + RTEXT "Weight:", IDC_STATIC, 76, 104, 40, 12, SS_CENTERIMAGE + COMBOBOX IDC_FONTWEIGHT, 144, 104, 50, 78, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Fixed Pitch:", IDC_FONTFIXED, "Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | BS_VCENTER | WS_TABSTOP, 7, 100, 51, 12 + CONTROL "Italic", IDC_FONTITALIC, "Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | BS_VCENTER | WS_TABSTOP, 7, 112, 51, 12 + CONTROL "Bold", IDC_FONTBOLD, "Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_RIGHT | BS_VCENTER | WS_TABSTOP, 7, 124, 51, 12 + CONTROL "All", IDC_SZALL, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 7, 31, 10 + CONTROL "10px", IDC_SZ10, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 17, 31, 10 + CONTROL "12px", IDC_SZ12, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 27, 31, 10 + CONTROL "14px", IDC_SZ14, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 37, 31, 10 + CONTROL "16px", IDC_SZ16, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 47, 31, 10 + CONTROL "18px", IDC_SZ18, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 57, 31, 10 + CONTROL "20px", IDC_SZ20, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 67, 31, 10 + CONTROL "22px", IDC_SZ22, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 77, 31, 10 + CONTROL "24px", IDC_SZ24, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 87, 31, 10 + CONTROL "26px", IDC_SZ26, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 17, 31, 10 + CONTROL "28px", IDC_SZ28, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 27, 31, 10 + CONTROL "32px", IDC_SZ32, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 37, 31, 10 + CONTROL "36px", IDC_SZ36, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 47, 31, 10 + CONTROL "40px", IDC_SZ40, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 57, 31, 10 + CONTROL "48px", IDC_SZ48, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 67, 31, 10 + CONTROL "56px", IDC_SZ56, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 77, 31, 10 + CONTROL "64px", IDC_SZ64, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 42, 87, 31, 10 END - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -66,7 +71,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 184 TOPMARGIN, 7 - BOTTOMMARGIN, 85 + BOTTOMMARGIN, 200 END END #endif // APSTUDIO_INVOKED diff --git a/resource.h b/resource.h index c1d822a..9b19d56 100644 --- a/resource.h +++ b/resource.h @@ -9,6 +9,9 @@ #define IDC_CHOOSE 1003 #define IDC_FONTWEIGHT 1004 #define IDC_FONTFIXED 1005 +#define IDC_FONTBOLD 1045 +#define IDC_FONTITALIC 1051 +#define IDC_SZALL 1009 #define IDC_SZ10 1010 #define IDC_SZ12 1011 #define IDC_SZ14 1012 @@ -26,6 +29,8 @@ #define IDC_SZ56 1024 #define IDC_SZ64 1025 #define IDC_STATIC 200 +#define IDC_PREVIEW 2001 +#define IDC_PREVIEWTEXT 2002 // Next default values for new objects //