Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions Headers/Additions/GNUstepGUI/GSFontAssetDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,40 +219,6 @@ GS_EXPORT_CLASS
fontName: (NSString *)fontName
error: (NSError **)error;

/**
* Validates a downloaded font file.
* This method can be overridden to implement custom validation
* logic, such as checking font metadata, licensing information,
* or performing security scans. The default implementation
* checks file existence, size, and format signatures.
*/
- (BOOL) validateFontFile: (NSString *)fontPath
error: (NSError **)error;

/**
* Installs a font file to the appropriate system location.
* This method can be overridden to implement custom installation
* strategies, such as using system APIs, registering with font
* management services, or applying custom permissions. Returns
* YES if installation was successful, NO otherwise.
*/
- (BOOL) installFontAtPath: (NSString *)fontPath
error: (NSError **)error;

/**
* Returns the system fonts directory for the current platform.
* This method can be overridden to customize the system font
* installation location or to support additional platforms.
*/
- (NSString *) systemFontsDirectory;

/**
* Returns the user fonts directory for the current platform.
* This method can be overridden to customize the user font
* installation location or to support additional platforms.
*/
- (NSString *) userFontsDirectory;

/**
* Returns the options that were specified when creating this downloader.
*/
Expand Down
71 changes: 71 additions & 0 deletions Headers/Additions/GNUstepGUI/GSFontAssetInstaller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* Implementation of class GSFontAssetInstaller
Copyright (C) 2024 Free Software Foundation, Inc.

By: Gregory John Casamento <greg.casamento@gmail.com>
Date: September 5, 2025

This file is part of the GNUstep Library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/

#ifndef GSFONTASSETINSTALLER_H
#define GSFONTASSETINSTALLER_H

#import <Foundation/NSObject.h>

@interface GSFontAssetInstaller : NSObject

+ (GSFontAssetInstaller *) sharedFontInstaller;
+ (void) setDefaultClass: (Class)cls;

// abstract methods

/**
* Validates a downloaded font file.
* This method can be overridden to implement custom validation
* logic, such as checking font metadata, licensing information,
* or performing security scans. The default implementation
* checks file existence, size, and format signatures.
*/
- (BOOL) validateFontPath: (NSString *)fontPath error: (NSError **)error;

/**
* Installs a font file to the appropriate system location.
* This method can be overridden to implement custom installation
* strategies, such as using system APIs, registering with font
* management services, or applying custom permissions. Returns
* YES if installation was successful, NO otherwise.
*/
- (BOOL) installFontPath: (NSString *)fontPath error: (NSError **)error;

/**
* Returns the system fonts directory for the current platform.
* This method can be overridden to customize the system font
* installation location or to support additional platforms.
*/
- (NSString *) systemFontsDirectory;

/**
* Returns the user fonts directory for the current platform.
* This method can be overridden to customize the user font
* installation location or to support additional platforms.
*/
- (NSString *) userFontsDirectory;

@end

#endif
6 changes: 4 additions & 2 deletions Source/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ GSCSEditInfo.m \
GSCSEditVariableManager.m \
GSCSTableau.m \
GSColorSliderCell.m \
GSFontAssetDownloader.m
GSFontAssetDownloader.m \
GSFontAssetInstaller.m

# Turn off NSMenuItem warning that NSMenuItem conforms to <NSObject>,
# but does not implement <NSObject>'s methods itself (it inherits
Expand Down Expand Up @@ -695,7 +696,8 @@ GSXibElement.h \
GSXibLoading.h \
GSXibKeyedUnarchiver.h \
GSHelpAttachment.h \
GSFontAssetDownloader.h
GSFontAssetDownloader.h \
GSFontAssetInstaller.h

libgnustep-gui_HEADER_FILES = ${GUI_HEADERS}

Expand Down
Loading