@@ -172,19 +172,19 @@ private void addFontFromWidget(PDResources acroFormResources, PDAnnotation annot
172172 {
173173 acroFormResources .put (fontName , widgetResources .getFont (fontName ));
174174 LOG .debug ("added font resource to AcroForm from widget for font name {}" ,
175- fontName .getName ());
175+ () -> fontName .getName ());
176176 }
177177 }
178178 catch (IOException ioe )
179179 {
180180 LOG .debug ("unable to add font to AcroForm for font name {}" ,
181- fontName .getName ());
181+ () -> fontName .getName ());
182182 }
183183 }
184184 else
185185 {
186186 LOG .debug ("font resource for widget was a subsetted font - ignored: {}" ,
187- fontName .getName ());
187+ () -> fontName .getName ());
188188 }
189189 });
190190 }
@@ -239,17 +239,20 @@ private void ensureFontResources(PDResources defaultResources, PDVariableText fi
239239 if (defaultResources .getFont (fontName ) == null )
240240 {
241241 LOG .debug ("trying to add missing font resource for field {}" ,
242- field .getFullyQualifiedName ());
242+ () -> field .getFullyQualifiedName ());
243243 FontMapper mapper = FontMappers .instance ();
244244 FontMapping <TrueTypeFont > fontMapping = mapper .getTrueTypeFont (fontName .getName () , null );
245245 if (fontMapping != null )
246246 {
247247 PDType0Font pdFont = PDType0Font .load (document , fontMapping .getFont (), false );
248- LOG .debug ("looked up font for {} - found {}" , fontName .getName (),
249- fontMapping .getFont ().getName ());
248+ if (LOG .isDebugEnabled ())
249+ {
250+ LOG .debug ("looked up font for {} - found {}" , fontName .getName (),
251+ fontMapping .getFont ().getName ());
252+ }
250253 defaultResources .put (fontName , pdFont );
251254 }
252- else
255+ else if ( LOG . isDebugEnabled ())
253256 {
254257 LOG .debug ("no suitable font found for field {} for font name {}" ,
255258 field .getFullyQualifiedName (), fontName .getName ());
@@ -258,8 +261,11 @@ private void ensureFontResources(PDResources defaultResources, PDVariableText fi
258261 }
259262 catch (IOException ioe )
260263 {
261- LOG .debug ("unable to handle font resources for field {}: {}" ,
262- field .getFullyQualifiedName (), ioe .getMessage ());
264+ if (LOG .isDebugEnabled ())
265+ {
266+ LOG .debug ("unable to handle font resources for field {}: {}" ,
267+ field .getFullyQualifiedName (), ioe .getMessage ());
268+ }
263269 }
264270 }
265271 }
0 commit comments