-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the font is not available but the OS is supported, OSFont will be empty but OSFontSize will have the value of the system font size. Also, FONTEXIST was made into a separate function.
- Loading branch information
Showing
3 changed files
with
38 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function bool = fontexist(font) | ||
%FONTEXIST Check existence of font. | ||
% FONTEXIST(FONT) returns TRUE if FONT is an available system font. | ||
|
||
% Created 2016-01-05 by Jorg C. Woehl | ||
% 2016-12-16 (JCW): Converted to standalone function, comments added. | ||
|
||
% input: empty character array, or nonempty character vector | ||
assert(ischar(font) && (isrow(font) || isempty(font)),... | ||
'fontexist:IncorrectInputType', 'Input must be an empty character array or a nonempty character vector.'); | ||
if isempty(font) | ||
% reduce to simplest empty type | ||
font = ''; | ||
end | ||
|
||
idx = find(strcmpi(listfonts, font), 1); | ||
bool = ~isempty(idx); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters