Skip to content

Commit 166c85c

Browse files
committed
Minor error message polish for saving WOFF.
1 parent 93d4ed2 commit 166c85c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

MainWindow.ixx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,19 +1968,20 @@ HRESULT MainWindow::SaveUnpackedWoffFontFile()
19681968

19691969
saveFilePath = openFilePath;
19701970
RemoveFileNameExtension(IN OUT saveFilePath);
1971-
if (!GetSaveFileName(hwnd_, saveFilters, u"otf", saveFilePath.c_str(), OUT saveFilePath))
1971+
if (!GetSaveFileName(hwnd_, saveFilters, u"otf", saveFilePath.c_str(), OUT saveFilePath, u"Save unpacked OpenType font file"))
19721972
return S_FALSE;
19731973

19741974
std::vector<uint8_t> fileData;
19751975
IFR(ShowMessageIfError(
1976-
u"Could not read file",
1977-
ReadBinaryFile(openFilePath.c_str(), OUT fileData)
1976+
u"Could not read WOFF file (error = %08X) '%s'",
1977+
ReadBinaryFile(openFilePath.c_str(), OUT fileData),
1978+
openFilePath.c_str()
19781979
));
19791980

19801981
DWRITE_CONTAINER_TYPE containerType = dwriteFactory->AnalyzeContainerType(fileData.data(), static_cast<uint32_t>(fileData.size()));
19811982
if (containerType == DWRITE_CONTAINER_TYPE_UNKNOWN)
19821983
{
1983-
ShowMessageAndAppendLog(u"Unknown container type for file '%s'", openFilePath.c_str());
1984+
ShowMessageAndAppendLog(u"Unknown container type for file '%s'. Expect WOFF or WOFF2.", openFilePath.c_str());
19841985
return DWRITE_E_FILEFORMAT;
19851986
}
19861987

@@ -1993,12 +1994,12 @@ HRESULT MainWindow::SaveUnpackedWoffFontFile()
19931994
));
19941995

19951996
IFR(ShowMessageIfError(
1996-
u"Could not write font to file. Error = 0x%08X writing to '%s'.",
1997+
u"Could not write unpacked font to file (error = 0x%08X) '%s'.",
19971998
SaveDWriteFontFile(fontFileStream, saveFilePath.c_str()),
19981999
saveFilePath.c_str()
19992000
));
20002001

2001-
AppendLog(u"Wrote font to file '%s'.\r\n", saveFilePath.c_str());
2002+
AppendLog(u"Wrote unpacked font to file '%s'.\r\n", saveFilePath.c_str());
20022003
return S_OK;
20032004
}
20042005

0 commit comments

Comments
 (0)