Skip to content

Commit 1b38d22

Browse files
committed
Add MonospaceFontTest test
DEVSIX-3809
1 parent f1f4961 commit 1b38d22

File tree

6 files changed

+73
-0
lines changed

6 files changed

+73
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2020 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
package com.itextpdf.io.font;
24+
25+
import com.itextpdf.test.ExtendedITextTest;
26+
import com.itextpdf.test.annotations.type.UnitTest;
27+
import org.junit.Assert;
28+
import org.junit.Test;
29+
import org.junit.experimental.categories.Category;
30+
31+
@Category(UnitTest.class)
32+
public class MonospaceFontTest extends ExtendedITextTest {
33+
private static final String sourceFolder = "./src/test/resources/com/itextpdf/io/font/MonospaceFontTest/";
34+
35+
@Test
36+
public void openMono() throws java.io.IOException {
37+
TrueTypeFont font = new TrueTypeFont(sourceFolder + "DejaVuSansMono.ttf");
38+
Assert.assertNotNull(font.getGlyph('A'));
39+
}
40+
41+
@Test
42+
public void openSans() throws java.io.IOException {
43+
TrueTypeFont font = new TrueTypeFont(sourceFolder + "DejaVuSans.ttf");
44+
Assert.assertNotNull(font.getGlyph('A'));
45+
}
46+
47+
@Test
48+
public void openSerif() throws java.io.IOException {
49+
TrueTypeFont font = new TrueTypeFont(sourceFolder + "DejaVuSerif.ttf");
50+
Assert.assertNotNull(font.getGlyph('A'));
51+
}
52+
53+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
6+
7+
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
8+
9+
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
10+
11+
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
12+
13+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
14+
15+
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
These fonts are under Bitstream Vera Fonts Copyright:
2+
3+
DejaVuSans.ttf
4+
DejaVuSansMono.ttf
5+
DejaVuSerif.ttf

0 commit comments

Comments
 (0)