Skip to content

Commit 97b10fe

Browse files
committed
Merge branch 'master' into NSMovie_branch
2 parents 9c580d5 + d8549cc commit 97b10fe

File tree

6 files changed

+164
-256
lines changed

6 files changed

+164
-256
lines changed

Headers/Additions/GNUstepGUI/GSFontAssetDownloader.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -219,40 +219,6 @@ GS_EXPORT_CLASS
219219
fontName: (NSString *)fontName
220220
error: (NSError **)error;
221221

222-
/**
223-
* Validates a downloaded font file.
224-
* This method can be overridden to implement custom validation
225-
* logic, such as checking font metadata, licensing information,
226-
* or performing security scans. The default implementation
227-
* checks file existence, size, and format signatures.
228-
*/
229-
- (BOOL) validateFontFile: (NSString *)fontPath
230-
error: (NSError **)error;
231-
232-
/**
233-
* Installs a font file to the appropriate system location.
234-
* This method can be overridden to implement custom installation
235-
* strategies, such as using system APIs, registering with font
236-
* management services, or applying custom permissions. Returns
237-
* YES if installation was successful, NO otherwise.
238-
*/
239-
- (BOOL) installFontAtPath: (NSString *)fontPath
240-
error: (NSError **)error;
241-
242-
/**
243-
* Returns the system fonts directory for the current platform.
244-
* This method can be overridden to customize the system font
245-
* installation location or to support additional platforms.
246-
*/
247-
- (NSString *) systemFontsDirectory;
248-
249-
/**
250-
* Returns the user fonts directory for the current platform.
251-
* This method can be overridden to customize the user font
252-
* installation location or to support additional platforms.
253-
*/
254-
- (NSString *) userFontsDirectory;
255-
256222
/**
257223
* Returns the options that were specified when creating this downloader.
258224
*/
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* Implementation of class GSFontAssetInstaller
2+
Copyright (C) 2024 Free Software Foundation, Inc.
3+
4+
By: Gregory John Casamento <greg.casamento@gmail.com>
5+
Date: September 5, 2025
6+
7+
This file is part of the GNUstep Library.
8+
9+
This library is free software; you can redistribute it and/or
10+
modify it under the terms of the GNU Lesser General Public
11+
License as published by the Free Software Foundation; either
12+
version 2.1 of the License, or (at your option) any later version.
13+
14+
This library is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
Lesser General Public License for more details.
18+
19+
You should have received a copy of the GNU Lesser General Public
20+
License along with this library; if not, write to the Free
21+
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22+
Boston, MA 02110 USA.
23+
*/
24+
25+
#ifndef GSFONTASSETINSTALLER_H
26+
#define GSFONTASSETINSTALLER_H
27+
28+
#import <Foundation/NSObject.h>
29+
30+
@interface GSFontAssetInstaller : NSObject
31+
32+
+ (GSFontAssetInstaller *) sharedFontInstaller;
33+
+ (void) setDefaultClass: (Class)cls;
34+
35+
// abstract methods
36+
37+
/**
38+
* Validates a downloaded font file.
39+
* This method can be overridden to implement custom validation
40+
* logic, such as checking font metadata, licensing information,
41+
* or performing security scans. The default implementation
42+
* checks file existence, size, and format signatures.
43+
*/
44+
- (BOOL) validateFontPath: (NSString *)fontPath error: (NSError **)error;
45+
46+
/**
47+
* Installs a font file to the appropriate system location.
48+
* This method can be overridden to implement custom installation
49+
* strategies, such as using system APIs, registering with font
50+
* management services, or applying custom permissions. Returns
51+
* YES if installation was successful, NO otherwise.
52+
*/
53+
- (BOOL) installFontPath: (NSString *)fontPath error: (NSError **)error;
54+
55+
/**
56+
* Returns the system fonts directory for the current platform.
57+
* This method can be overridden to customize the system font
58+
* installation location or to support additional platforms.
59+
*/
60+
- (NSString *) systemFontsDirectory;
61+
62+
/**
63+
* Returns the user fonts directory for the current platform.
64+
* This method can be overridden to customize the user font
65+
* installation location or to support additional platforms.
66+
*/
67+
- (NSString *) userFontsDirectory;
68+
69+
@end
70+
71+
#endif

Source/GNUmakefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ GSCSEditInfo.m \
375375
GSCSEditVariableManager.m \
376376
GSCSTableau.m \
377377
GSColorSliderCell.m \
378-
GSFontAssetDownloader.m
378+
GSFontAssetDownloader.m \
379+
GSFontAssetInstaller.m
379380

380381
ifeq ($(BUILD_MOVIE), yes)
381382
libgnustep-gui_OBJC_FILES += GSMovieView.m
@@ -701,7 +702,8 @@ GSXibElement.h \
701702
GSXibLoading.h \
702703
GSXibKeyedUnarchiver.h \
703704
GSHelpAttachment.h \
704-
GSFontAssetDownloader.h
705+
GSFontAssetDownloader.h \
706+
GSFontAssetInstaller.h
705707

706708
libgnustep-gui_HEADER_FILES = ${GUI_HEADERS}
707709

0 commit comments

Comments
 (0)