01 /*
02 * Copyright 2015-2018 Andres Almiray
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kordamp.ikonli.websymbols;
17
18 import org.kordamp.ikonli.AbstractIkonHandler;
19 import org.kordamp.ikonli.Ikon;
20 import org.kordamp.ikonli.IkonHandler;
21 import org.kordamp.jipsy.ServiceProviderFor;
22
23 /**
24 * @author Andres Almiray
25 */
26 @ServiceProviderFor(IkonHandler.class)
27 public class WebsymbolsIkonHandler extends AbstractIkonHandler {
28 @Override
29 public boolean supports(String description) {
30 return description != null && description.startsWith("ws-");
31 }
32
33 @Override
34 public Ikon resolve(String description) {
35 return Websymbols.findByDescription(description);
36 }
37
38 @Override
39 public String getFontResourcePath() {
40 return "META-INF/resources/websymbols/0.0/fonts/websymbols.ttf";
41 }
42
43 @Override
44 public String getFontFamily() {
45 return "WebSymbols";
46 }
47 }
|