File tree Expand file tree Collapse file tree 4 files changed +63
-1
lines changed
java/com/aspose/imaging/examples/metafile
resources/com/aspose/imaging/examples/metafile/GetFontInfo Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 1414 <dependency >
1515 <groupId >com.aspose</groupId >
1616 <artifactId >aspose-imaging</artifactId >
17- <version >3.0</version >
17+ <version >3.0.2 </version >
1818 <classifier >jdk16</classifier >
1919 </dependency >
2020 </dependencies >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2001-2015 Aspose Pty Ltd. All Rights Reserved.
3+ *
4+ * This file is part of Aspose.Imaging. The source code in this file
5+ * is only intended as a supplement to the documentation, and is provided
6+ * "as is", without warranty of any kind, either expressed or implied.
7+ */
8+ package com .aspose .imaging .examples .metafile ;
9+
10+ import com .aspose .imaging .examples .Utils ;
11+ import com .aspose .imaging .fileformats .metafile .FontSettings ;
12+ import com .aspose .imaging .fileformats .metafile .MetafileImage ;
13+ import com .aspose .imaging .fileformats .metafile .EmfMetafileImage ;
14+
15+ public class GetFontInfo {
16+
17+ public static void main (String ... args ) throws Exception {
18+ String dataDir = Utils .getDataDir (GetFontInfo .class );
19+
20+ System .out .println ("Get list of font names accessible to Aspose.Imaging API" );
21+ for (String f : FontSettings .getAllFonts ()) {
22+ System .out .println ("\t " + f );
23+ }
24+
25+ System .out .println ("Get list of font names used in the metafile" );
26+ MetafileImage metafile = new EmfMetafileImage (dataDir + "Sample1.emf" );
27+ for (String f : metafile .getUsedFonts ()) {
28+ System .out .println ("\t " + f );
29+ }
30+
31+ System .out .println ("Get list of font names that are missing" );
32+ for (String f : metafile .getMissedFonts ()) {
33+ System .out .println ("\t " + f );
34+ }
35+ }
36+ }
37+
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2001-2015 Aspose Pty Ltd. All Rights Reserved.
3+ *
4+ * This file is part of Aspose.Imaging. The source code in this file
5+ * is only intended as a supplement to the documentation, and is provided
6+ * "as is", without warranty of any kind, either expressed or implied.
7+ */
8+ package com .aspose .imaging .examples .metafile ;
9+
10+ import java .nio .file .Paths ;
11+ import com .aspose .imaging .fileformats .metafile .FontSettings ;
12+
13+ public class SpecifyFontFolder {
14+
15+ public static void main (String ... args ) throws Exception {
16+ String fonts = Paths .get (System .getProperty ("user.home" ), "Fonts" ).toString ();
17+ System .out .println ("Adding fonts from user's home directory: " + fonts );
18+ FontSettings .addFontsFolder (fonts );
19+
20+ System .out .println ("List of all fonts:" );
21+ for (String f : FontSettings .getAllFonts ()) {
22+ System .out .println ("\t " + f );
23+ }
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments