getOSfont

버전 1.1.3.1 (4.4 KB) 작성자: Jorg Woehl
Name and size of the system user interface font (default system font)
다운로드 수: 52
업데이트 날짜: 2021/5/6

View getOSfont on File Exchange

getOSfont

getOSfont returns the name and size of the system user interface font (default system font).

Purpose

Graphical user interfaces developed with MATLAB often lack the look and feel of native applications, which is in part due to the fact that they do not use the user interface font of the operating system on which they are running. getOSfont resolves this issue by returning the name and size of the system UI font for a variety of platforms and OS versions, including all platforms officially supported by R2014b and above.

Usage

[OSFont, OSFontSize] = getOSfont(OS, OSVersion) returns the name and size (in points) of the system UI font of the operating system OS in version OSVersion. If the system UI font is not available to MATLAB, it is replaced by a similar font and a warning is issued. If the OS is not supported, OSFONT and OSFONTSIZE are returned empty. If the font selected by getOSfont is not available on the system, OSFONT is returned empty.

OS is a character vector containing the name of the operating system in lowercase letters. The following operating systems are supported:

  • 'windows' (starting with Windows 3.1)
  • 'macos' (all OS X and macOS versions)
  • 'ubuntu' (starting with Ubuntu 10.10)
  • 'centos' and 'redhat' (starting with version 6.8)

OSVersion is a numeric vector representing the version number of the operating system. For example, OSVersion = [6, 1, 7601] corresponds to version 6.1.7601.

getOSfont is typically used in tandem with detectOS.

Example:

% avoid error if OS cannot be determined
try
   [OS, OSVersion] = detectOS;
catch
   OS = '';
   OSVersion = [];
end

[OSFont, OSFontSize] = getOSfont(OS, OSVersion);
% if returned empty, fall back on factory settings
if isempty(OSFont)
   OSFont = get(groot, 'factoryUicontrolFontName');
end
if isempty(OSFontSize)
   OSFontSize = get(groot, 'factoryUicontrolFontSize');
end

Requirements

getOSfont is compatible with MATLAB R2013a and later releases.

Feedback

Any feedback or help in extending the code to other operating systems/versions is welcome!

인용 양식

Jorg Woehl (2024). getOSfont (https://github.com/JorgWoehl/getOSfont/releases/tag/v1.1.3.1), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2013a
R2013a 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.1.3.1

See release notes for this release on GitHub: https://github.com/JorgWoehl/getOSfont/releases/tag/v1.1.3.1

1.1.0.0

Refine input validation
OSFont and OSFontSize are now treated separately. FONTEXIST is now a separate function.

1.0.0.0

Added link to detectOS
Added image

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.