mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
MacPDF: Don't hardcode my serenity directory
https://www.africau.edu/images/default/sample.pdf is a good document for testing that the built-in fonts load.
This commit is contained in:
parent
8a7d3cb3f4
commit
e4d2aa82e2
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/e4d2aa82e2 Pull-request: https://github.com/SerenityOS/serenity/pull/21272
1 changed files with 8 additions and 3 deletions
|
@ -16,9 +16,14 @@
|
|||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
||||
{
|
||||
// FIXME: copy the fonts to the bundle or something
|
||||
auto source_root = DeprecatedString("/Users/thakis/src/serenity");
|
||||
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root));
|
||||
// FIXME: Copy the fonts to the bundle or something
|
||||
|
||||
// Get from `Build/lagom/bin/MacPDF.app/Contents/MacOS/MacPDF` to `.`.
|
||||
NSString* source_root = [[NSBundle mainBundle] executablePath];
|
||||
for (int i = 0; i < 7; ++i)
|
||||
source_root = [source_root stringByDeletingLastPathComponent];
|
||||
auto source_root_string = DeprecatedString([source_root UTF8String]);
|
||||
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root_string));
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification*)aNotification
|
||||
|
|
Loading…
Add table
Reference in a new issue