1 /*******************************************************************************
2 * Copyright (c) 2000, 2019 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.internal.cocoa;
15
16 public class NSFontManager extends NSObject {
17
NSFontManager()18 public NSFontManager() {
19 super();
20 }
21
NSFontManager(long id)22 public NSFontManager(long id) {
23 super(id);
24 }
25
NSFontManager(id id)26 public NSFontManager(id id) {
27 super(id);
28 }
29
availableFontFamilies()30 public NSArray availableFontFamilies() {
31 long result = OS.objc_msgSend(this.id, OS.sel_availableFontFamilies);
32 return result != 0 ? new NSArray(result) : null;
33 }
34
availableMembersOfFontFamily(NSString fam)35 public NSArray availableMembersOfFontFamily(NSString fam) {
36 long result = OS.objc_msgSend(this.id, OS.sel_availableMembersOfFontFamily_, fam != null ? fam.id : 0);
37 return result != 0 ? new NSArray(result) : null;
38 }
39
convertFont(NSFont fontObj, long trait)40 public NSFont convertFont(NSFont fontObj, long trait) {
41 long result = OS.objc_msgSend(this.id, OS.sel_convertFont_toHaveTrait_, fontObj != null ? fontObj.id : 0, trait);
42 return result != 0 ? new NSFont(result) : null;
43 }
44
sharedFontManager()45 public static NSFontManager sharedFontManager() {
46 long result = OS.objc_msgSend(OS.class_NSFontManager, OS.sel_sharedFontManager);
47 return result != 0 ? new NSFontManager(result) : null;
48 }
49
traitsOfFont(NSFont fontObj)50 public long traitsOfFont(NSFont fontObj) {
51 return OS.objc_msgSend(this.id, OS.sel_traitsOfFont_, fontObj != null ? fontObj.id : 0);
52 }
53
54 }
55