mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-28 05:07:42 +00:00
Simplified means of setting the default system font, now the CPSystemFontFace item only needs to be added to AppKit/Info.plist.
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ var _CPFonts = {},
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
var systemFont = [[CPBundle mainBundle] objectForInfoDictionaryKey:"CPSystemFontFace"];
|
||||
var systemFont = [[CPBundle bundleForClass:[CPView class]] objectForInfoDictionaryKey:"CPSystemFontFace"];
|
||||
|
||||
if (systemFont)
|
||||
_CPFontSystemFontFace = systemFont;
|
||||
|
||||
@@ -33,24 +33,12 @@ NibFormatIPhone = 2;
|
||||
|
||||
ConverterConversionException = @"ConverterConversionException";
|
||||
|
||||
SharedConverterInstance = nil;
|
||||
|
||||
|
||||
@implementation Converter : CPObject
|
||||
{
|
||||
NibFormat format @accessors;
|
||||
CPString inputPath @accessors;
|
||||
CPString outputPath @accessors;
|
||||
CPString resourcesPath @accessors;
|
||||
CPString systemFontFace @accessors;
|
||||
}
|
||||
|
||||
+ (Converter)sharedConverterInstance
|
||||
{
|
||||
if (!SharedConverterInstance)
|
||||
SharedConverterInstance = [[Converter alloc] init];
|
||||
|
||||
return SharedConverterInstance;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
|
||||
+6
-18
@@ -30,8 +30,6 @@
|
||||
@import "Nib2CibKeyedUnarchiver.j"
|
||||
@import "Converter.j"
|
||||
|
||||
var DefaultSystemFontFace = "Arial, sans-serif";
|
||||
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
|
||||
@@ -47,10 +45,6 @@ parser.option("-R", "resources")
|
||||
.set()
|
||||
.help("Set the Resources directory");
|
||||
|
||||
parser.option("--systemFontFace", "systemFontFace")
|
||||
.set()
|
||||
.help("Set the default system font");
|
||||
|
||||
parser.option("--mac", "format")
|
||||
.set(NibFormatMac)
|
||||
.def(NibFormatUndetermined)
|
||||
@@ -97,9 +91,6 @@ function main(args)
|
||||
parser.printUsage(options);
|
||||
OS.exit(1);
|
||||
}
|
||||
|
||||
if (!options.systemFontFace)
|
||||
options.systemFontFace = [CPFont systemFontFace];
|
||||
|
||||
if (options.quiet) {}
|
||||
else if (options.verbose === 0)
|
||||
@@ -109,21 +100,18 @@ function main(args)
|
||||
else
|
||||
CPLogRegister(CPLogPrint);
|
||||
|
||||
CPLog.debug("Input: " + options.args[0]);
|
||||
CPLog.debug("Output: " + (options.args[1]||""));
|
||||
CPLog.debug("Format: " + ["Auto","Mac","iPhone"][options.format]);
|
||||
CPLog.debug("Resources: " + (options.resources||""));
|
||||
CPLog.debug("Frameworks: " + options.frameworks);
|
||||
CPLog.debug("System font: " + options.systemFontFace);
|
||||
CPLog.debug("Input: " + options.args[0]);
|
||||
CPLog.debug("Output: " + (options.args[1]||""));
|
||||
CPLog.debug("Format: " + ["Auto","Mac","iPhone"][options.format]);
|
||||
CPLog.debug("Resources: " + (options.resources||""));
|
||||
CPLog.debug("Frameworks: " + options.frameworks);
|
||||
|
||||
var converter = [Converter sharedConverterInstance];
|
||||
var converter = [[Converter alloc] init];
|
||||
|
||||
if (options.resources)
|
||||
[converter setResourcesPath:options.resources];
|
||||
|
||||
[converter setFormat:options.format];
|
||||
|
||||
[converter setSystemFontFace:options.systemFontFace];
|
||||
|
||||
[converter setInputPath:options.args[0]];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user