mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-18 20:04:17 +01:00
minor stuff
This commit is contained in:
parent
b03ecef121
commit
c390f21114
@ -323,7 +323,10 @@ public class PdfJsonFallbackFontService {
|
||||
|
||||
@jakarta.annotation.PostConstruct
|
||||
private void loadConfig() {
|
||||
String configured = applicationProperties.getPdfEditor().getFallbackFont();
|
||||
String configured = null;
|
||||
if (applicationProperties.getPdfEditor() != null) {
|
||||
configured = applicationProperties.getPdfEditor().getFallbackFont();
|
||||
}
|
||||
if (configured != null && !configured.isBlank()) {
|
||||
fallbackFontLocation = configured;
|
||||
} else {
|
||||
|
||||
@ -72,12 +72,19 @@ public class PdfJsonFontService {
|
||||
}
|
||||
|
||||
private void loadConfiguration() {
|
||||
var cfg = applicationProperties.getPdfEditor().getCffConverter();
|
||||
this.cffConversionEnabled = cfg.isEnabled();
|
||||
this.cffConverterMethod = cfg.getMethod();
|
||||
this.pythonCommand = cfg.getPythonCommand();
|
||||
this.pythonScript = cfg.getPythonScript();
|
||||
this.fontforgeCommand = cfg.getFontforgeCommand();
|
||||
if (applicationProperties.getPdfEditor() != null
|
||||
&& applicationProperties.getPdfEditor().getCffConverter() != null) {
|
||||
var cfg = applicationProperties.getPdfEditor().getCffConverter();
|
||||
this.cffConversionEnabled = cfg.isEnabled();
|
||||
this.cffConverterMethod = cfg.getMethod();
|
||||
this.pythonCommand = cfg.getPythonCommand();
|
||||
this.pythonScript = cfg.getPythonScript();
|
||||
this.fontforgeCommand = cfg.getFontforgeCommand();
|
||||
} else {
|
||||
// Use defaults when config is not available
|
||||
this.cffConversionEnabled = false;
|
||||
log.warn("[FONT-DEBUG] PdfEditor configuration not available, CFF conversion disabled");
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] convertCffProgramToTrueType(byte[] fontBytes, String toUnicode) {
|
||||
|
||||
@ -43,8 +43,15 @@ public class Type3LibraryStrategy implements Type3ConversionStrategy {
|
||||
|
||||
@jakarta.annotation.PostConstruct
|
||||
private void loadConfiguration() {
|
||||
var cfg = applicationProperties.getPdfEditor().getType3().getLibrary();
|
||||
this.enabled = cfg.isEnabled();
|
||||
if (applicationProperties.getPdfEditor() != null
|
||||
&& applicationProperties.getPdfEditor().getType3() != null
|
||||
&& applicationProperties.getPdfEditor().getType3().getLibrary() != null) {
|
||||
var cfg = applicationProperties.getPdfEditor().getType3().getLibrary();
|
||||
this.enabled = cfg.isEnabled();
|
||||
} else {
|
||||
this.enabled = false;
|
||||
log.warn("PdfEditor Type3 library configuration not available, disabled");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -43,8 +43,16 @@ public class Type3FontLibrary {
|
||||
|
||||
@jakarta.annotation.PostConstruct
|
||||
void initialise() {
|
||||
this.indexLocation =
|
||||
applicationProperties.getPdfEditor().getType3().getLibrary().getIndex();
|
||||
if (applicationProperties.getPdfEditor() != null
|
||||
&& applicationProperties.getPdfEditor().getType3() != null
|
||||
&& applicationProperties.getPdfEditor().getType3().getLibrary() != null) {
|
||||
this.indexLocation =
|
||||
applicationProperties.getPdfEditor().getType3().getLibrary().getIndex();
|
||||
} else {
|
||||
log.warn("[TYPE3] PdfEditor Type3 library configuration not available; Type3 library disabled");
|
||||
entries = List.of();
|
||||
return;
|
||||
}
|
||||
Resource resource = resourceLoader.getResource(indexLocation);
|
||||
if (!resource.exists()) {
|
||||
log.info("[TYPE3] Library index {} not found; Type3 library disabled", indexLocation);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user