mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +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
1 changed files with 8 additions and 3 deletions
|
@ -16,9 +16,14 @@
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
// FIXME: copy the fonts to the bundle or something
|
// 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));
|
// 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
|
- (void)applicationWillTerminate:(NSNotification*)aNotification
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue