File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -139,9 +139,10 @@ public final void buildFontFile2(InputStream ttfStream) throws IOException
139139 */
140140 final boolean isEmbeddingPermitted (TrueTypeFont ttf ) throws IOException
141141 {
142- if (ttf .getOS2Windows () != null )
142+ OS2WindowsMetricsTable os2 = ttf .getOS2Windows ();
143+ if (os2 != null )
143144 {
144- int fsType = ttf . getOS2Windows () .getFsType ();
145+ int fsType = os2 .getFsType ();
145146 int maskedFsType = fsType & 0x000F ;
146147 // PDFBOX-5191: don't check the bit because permissions are exclusive
147148 if (maskedFsType == OS2WindowsMetricsTable .FSTYPE_RESTRICTED )
@@ -164,9 +165,10 @@ else if ((fsType & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) ==
164165 */
165166 private boolean isSubsettingPermitted (TrueTypeFont ttf ) throws IOException
166167 {
167- if (ttf .getOS2Windows () != null )
168+ OS2WindowsMetricsTable os2 = ttf .getOS2Windows ();
169+ if (os2 != null )
168170 {
169- int fsType = ttf . getOS2Windows () .getFsType ();
171+ int fsType = os2 .getFsType ();
170172 if ((fsType & OS2WindowsMetricsTable .FSTYPE_NO_SUBSETTING ) ==
171173 OS2WindowsMetricsTable .FSTYPE_NO_SUBSETTING )
172174 {
You can’t perform that action at this time.
0 commit comments