Skip to content

Commit d0c3ba6

Browse files
committed
Remove some old hacks.
1 parent 9d1c1fa commit d0c3ba6

2 files changed

Lines changed: 2 additions & 65 deletions

File tree

DrawableObject.ixx

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ HRESULT DrawableObjectDirect2DDrawGlyphRun::Draw(
24632463
d2dRenderTarget->SetTransform(&transform.d2d);
24642464
d2dRenderTarget->BeginDraw();
24652465

2466-
// hack::::
2466+
// debugging hack to draw rects behind glyphs.
24672467
#if 0
24682468
DWRITE_FONT_METRICS fontMetrics;
24692469
std::vector<DWRITE_GLYPH_METRICS> glyphMetricsArray(cachedGlyphRun.glyphCount);
@@ -2749,68 +2749,6 @@ HRESULT DrawableObjectDWriteBitmapRenderTargetLayoutDraw::Draw(
27492749

27502750
renderTarget->SetCurrentTransform(&DrawableObject::identityTransform.dwrite);
27512751

2752-
// hack:
2753-
#if 0
2754-
auto* factory = drawingCanvas.GetDWriteFactoryWeakRef();
2755-
ComPtr<IDWriteFactory6> factory6;
2756-
IFR(factory->QueryInterface(OUT &factory6));
2757-
ComPtr<IDWriteFontSet> fontSet;
2758-
ComPtr<IDWriteFontSetBuilder1> fontSetBuilder;
2759-
IFR(factory6->CreateFontSetBuilder(OUT &fontSetBuilder));
2760-
ComPtr<IDWriteFontFile> fontFile;
2761-
ComPtr<IDWriteFontFaceReference1> fontFaceReference;
2762-
FILETIME fileTime = {};
2763-
IFR(factory6->CreateFontFileReference(L"c:\\foo.ttf", &fileTime, OUT &fontFile));
2764-
IFR(factory6->CreateFontFaceReference(fontFile, 0, DWRITE_FONT_SIMULATIONS_NONE, nullptr, 0, OUT &fontFaceReference));
2765-
2766-
#if 0
2767-
ptr auto factory = drawingCanvas.Factory
2768-
Windows.FileTime fileTime = {}
2769-
auto fontSetBuilder = factory.CreateFontSetBuilder()
2770-
auto fontFile = factory.CreateFontFileReference("c:\\foo.ttf", fileTime)
2771-
auto fontFaceReference = factory.CreateFontFaceReference(fontFile, 0, DWrite.FontSimulations.None, nullptr, 0)
2772-
auto fontSet = fontSetBuilder.CreateFontSet()
2773-
2774-
const DWrite.FontProperty fontProperties0[] = {
2775-
{ DWrite.FontPropertyId.FamilyName, "arial", "" },
2776-
{ DWrite.FontPropertyId.FamilyName, "Arial", "" },
2777-
{ DWrite.FontPropertyId.FamilyName, "Trial", "" },
2778-
{ DWrite.FontPropertyId.FamilyName, "triaL", "" },
2779-
{ DWrite.FontPropertyId.FamilyName, "일반체", "" },
2780-
}
2781-
const DWrite.FontProperty fontProperties1[] = {
2782-
{ DWrite.FontPropertyId.FamilyName, "일반체", "" },
2783-
{ DWrite.FontPropertyId.FamilyName, "일반체", "" },
2784-
{ DWrite.FontPropertyId.FamilyName, "arial", "" },
2785-
}
2786-
2787-
#endif
2788-
2789-
const DWRITE_FONT_PROPERTY fontProperties0[] = {
2790-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"arial", L"" },
2791-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"Arial", L"" },
2792-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"Trial", L"" },
2793-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"triaL", L"" },
2794-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"일반체", L"" },
2795-
};
2796-
const DWRITE_FONT_PROPERTY fontProperties1[] = {
2797-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"일반체", L"" },
2798-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"일반체", L"" },
2799-
{ DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME, L"arial", L"" },
2800-
};
2801-
2802-
const array_ref<DWRITE_FONT_PROPERTY const> fontPropertiesArray[] = {
2803-
fontProperties0,
2804-
fontProperties1,
2805-
};
2806-
2807-
for (auto& fontProperties : fontPropertiesArray)
2808-
{
2809-
IFR(fontSetBuilder->AddFontFaceReference(fontFaceReference, fontProperties.data(), fontProperties.size()));
2810-
}
2811-
IFR(fontSetBuilder->CreateFontSet(OUT &fontSet));
2812-
#endif
2813-
28142752
return hr;
28152753
}
28162754

MainWindow.ixx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,8 +2956,7 @@ void MainWindow::ShowMessageAndAppendLog(const char16_t* logMessage, ...)
29562956
buffer[0] = 0;
29572957
StringCchVPrintf(OUT ToWChar(buffer), countof(buffer), ToWChar(logMessage), argList);
29582958

2959-
HWND__* h = reinterpret_cast<HWND__*>(hwnd_); // hack:::
2960-
MessageBoxShaded::Show(h, buffer, u"", MB_OK|MB_ICONWARNING);
2959+
MessageBoxShaded::Show(hwnd_, buffer, u"", MB_OK|MB_ICONWARNING);
29612960

29622961
AppendLogDirect(buffer);
29632962
if (buffer[wcslen(ToWChar(buffer))] != '\n')

0 commit comments

Comments
 (0)