+ NSArray *gothicChars = [NSArray arrayWithObjects:[NSString stringWithUTF8String:"☆"], [NSString stringWithUTF8String:"★"], nil];
+ NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:text];
+
+ if (([gothicChars count] > 0) && ([text length] > 0)) {
+ NSMutableString *gothicRegex = [[NSMutableString alloc] init];
+
+ [gothicRegex appendString:@"["];
+ for (NSString *gothicChar in gothicChars) {
+ [gothicRegex appendString:gothicChar];
+ }
+ [gothicRegex appendString:@"]+"];
+
+ NSUInteger endOfLastRange = 0;
+ NSRange foundRange;
+ while (endOfLastRange != NSNotFound) {
+ foundRange = [text rangeOfRegex:gothicRegex inRange:NSMakeRange(endOfLastRange, ([text length] - endOfLastRange))];
+ if (foundRange.location != NSNotFound) {
+ [attributedText setAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"AppleGothic" size:(18.0 / MINI_DIVISOR)], NSFontAttributeName, nil, nil] range:foundRange];
+ endOfLastRange = foundRange.location+foundRange.length;
+ if (endOfLastRange >= [text length]) {
+ endOfLastRange = NSNotFound;
+ }
+ } else {
+ endOfLastRange = NSNotFound;
+ }
+ }
+ }
+
+ switch ([GrowlPositionController selectedOriginPosition]) {
+ case GrowlMiddleColumnPosition:
+ [_window setVerticalPosition:ITWindowPositionMiddle];
+ [_window setHorizontalPosition:ITWindowPositionCenter];
+ break;
+ case GrowlTopLeftPosition:
+ [_window setVerticalPosition:ITWindowPositionTop];
+ [_window setHorizontalPosition:ITWindowPositionLeft];
+ break;
+ case GrowlBottomRightPosition:
+ [_window setVerticalPosition:ITWindowPositionBottom];
+ [_window setHorizontalPosition:ITWindowPositionRight];
+ break;
+ case GrowlTopRightPosition:
+ [_window setVerticalPosition:ITWindowPositionTop];
+ [_window setHorizontalPosition:ITWindowPositionRight];
+ break;
+ case GrowlBottomLeftPosition:
+ [_window setVerticalPosition:ITWindowPositionBottom];
+ [_window setHorizontalPosition:ITWindowPositionLeft];
+ break;
+ }
+