fix indentation errors in fonts.conf file created on apple and android platforms
This commit is contained in:
parent
7ca081a488
commit
862b0485e0
@ -430,14 +430,14 @@ public class FFmpegKitConfig {
|
||||
String mappedFontName = mapping.getValue();
|
||||
|
||||
if ((fontName != null) && (mappedFontName != null) && (fontName.trim().length() > 0) && (mappedFontName.trim().length() > 0)) {
|
||||
fontNameMappingBlock.append(" <match target=\"pattern\">\n");
|
||||
fontNameMappingBlock.append(" <test qual=\"any\" name=\"family\">\n");
|
||||
fontNameMappingBlock.append(String.format(" <string>%s</string>\n", fontName));
|
||||
fontNameMappingBlock.append(" </test>\n");
|
||||
fontNameMappingBlock.append(" <edit name=\"family\" mode=\"assign\" binding=\"same\">\n");
|
||||
fontNameMappingBlock.append(String.format(" <string>%s</string>\n", mappedFontName));
|
||||
fontNameMappingBlock.append(" </edit>\n");
|
||||
fontNameMappingBlock.append(" </match>\n");
|
||||
fontNameMappingBlock.append(" <match target=\"pattern\">\n");
|
||||
fontNameMappingBlock.append(" <test qual=\"any\" name=\"family\">\n");
|
||||
fontNameMappingBlock.append(String.format(" <string>%s</string>\n", fontName));
|
||||
fontNameMappingBlock.append(" </test>\n");
|
||||
fontNameMappingBlock.append(" <edit name=\"family\" mode=\"assign\" binding=\"same\">\n");
|
||||
fontNameMappingBlock.append(String.format(" <string>%s</string>\n", mappedFontName));
|
||||
fontNameMappingBlock.append(" </edit>\n");
|
||||
fontNameMappingBlock.append(" </match>\n");
|
||||
|
||||
validFontNameMappingCount++;
|
||||
}
|
||||
@ -455,7 +455,7 @@ public class FFmpegKitConfig {
|
||||
fontConfigBuilder.append("</dir>\n");
|
||||
}
|
||||
fontConfigBuilder.append(fontNameMappingBlock);
|
||||
fontConfigBuilder.append("</fontconfig>");
|
||||
fontConfigBuilder.append("</fontconfig>\n");
|
||||
|
||||
final AtomicReference<FileOutputStream> reference = new AtomicReference<>();
|
||||
try {
|
||||
|
@ -840,14 +840,14 @@ int executeFFprobe(long sessionId, NSArray* arguments) {
|
||||
if ((fontName != nil) && (mappedFontName != nil) && ([fontName length] > 0) && ([mappedFontName length] > 0)) {
|
||||
|
||||
fontNameMappingBlock = [NSString stringWithFormat:@"%@\n%@\n%@%@%@\n%@\n%@\n%@%@%@\n%@\n%@\n",
|
||||
@" <match target=\"pattern\">",
|
||||
@" <test qual=\"any\" name=\"family\">",
|
||||
@" <string>", fontName, @"</string>",
|
||||
@" </test>",
|
||||
@" <edit name=\"family\" mode=\"assign\" binding=\"same\">",
|
||||
@" <string>", mappedFontName, @"</string>",
|
||||
@" </edit>",
|
||||
@" </match>"];
|
||||
@" <match target=\"pattern\">",
|
||||
@" <test qual=\"any\" name=\"family\">",
|
||||
@" <string>", fontName, @"</string>",
|
||||
@" </test>",
|
||||
@" <edit name=\"family\" mode=\"assign\" binding=\"same\">",
|
||||
@" <string>", mappedFontName, @"</string>",
|
||||
@" </edit>",
|
||||
@" </match>"];
|
||||
|
||||
validFontNameMappingCount++;
|
||||
}
|
||||
@ -862,10 +862,10 @@ int executeFFprobe(long sessionId, NSArray* arguments) {
|
||||
NSString *fontDirectoryPath = [fontDirectoryArray objectAtIndex:i];
|
||||
[fontConfiguration appendString: @" <dir>"];
|
||||
[fontConfiguration appendString: fontDirectoryPath];
|
||||
[fontConfiguration appendString: @"</dir>"];
|
||||
[fontConfiguration appendString: @"</dir>\n"];
|
||||
}
|
||||
[fontConfiguration appendString:fontNameMappingBlock];
|
||||
[fontConfiguration appendString:@"</fontconfig>"];
|
||||
[fontConfiguration appendString:@"</fontconfig>\n"];
|
||||
|
||||
if (![fontConfiguration writeToFile:fontConfigurationFile atomically:YES encoding:NSUTF8StringEncoding error:&error]) {
|
||||
NSLog(@"Failed to set font directory. Error received while saving font configuration: %@.", error);
|
||||
|
Loading…
Reference in New Issue
Block a user