index : lingo-archipelago

this commit

experimental-panels

main

Randomizer client for LINGO using Archipelago Multiworld |

about summary refs log tree commit diff stats

log msg

author

committer

range

path: root/README.md

| Commit message (Collapse) | Author | Age | Files | Lines
* | It's always gonna be a zip | Star Rauchenberger | 2023-11-25 | 1 | -4/+2
| |
* | Update and format readme | Star Rauchenberger | 2023-11-25 | 1 | -57/+132
| |
* | README links to changelog now | Star Rauchenberger | 2023-10-03 | 1 | -1/+1
| |
* | Update README.md | Star Rauchenberger | 2023-09-27 | 1 | -1/+1
| |
* | Described fake pilgrimage in README | Star Rauchenberger | 2023-08-08 | 1 | -0/+23
| |
* | Made a note about how to access LEVEL 2 v0.9.0 | Star Rauchenberger | 2023-08-01 | 1 | -0/+2
| |
* | Update README.md | Star Rauchenberger | 2023-07-02 | 1 | -24/+8
| |
* | Update README.md | Star Rauchenberger | 2023-06-04 | 1 | -2/+3
| |
* | Fixed README typo | Star Rauchenberger | 2023-04-28 | 1 | -1/+1
| |
* | Updated README to say not wall sniping FOURTH is in logic | Star Rauchenberger | 2023-04-23 | 1 | -2/+2
| |
* | Added Hide and Seek to README | Star Rauchenberger | 2023-04-22 | 1 | -0/+1
| |
* | Added info about features and location checks to the README | Star Rauchenberger | 2023-04-21 | 1 | -1/+27

|

pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */

//
// FontLabel.m
// FontLabel
//
// Created by Kevin Ballard on 5/8/09.
// Copyright © 2009 Zynga Game Networks
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "FontLabel.h"
#import "FontManager.h"
#import "FontLabelStringDrawing.h"
#import "ZFont.h"

@interface ZFont (ZFontPrivate)
@property (nonatomic, readonly) CGFloat ratio;
@end

@implementation FontLabel
@synthesize zFont;
@synthesize zAttributedText;

- (id)initWithFrame:(CGRect)frame fontName:(NSString *)fontName pointSize:(CGFloat)pointSize {
return [self initWithFrame:frame zFont:[[FontManager sharedManager] zFontWithName:fontName pointSize:pointSize]];
}

- (id)initWithFrame:(CGRect)frame zFont:(ZFont *)font {
if ((self = [super initWithFrame:frame])) {
zFont = [font retain];
}
return self;
}

- (id)initWithFrame:(CGRect)frame font:(CGFontRef)font pointSize:(CGFloat)pointSize {
return [self initWithFrame:frame zFont:[ZFont fontWithCGFont:font size:pointSize]];
}

- (CGFontRef)cgFont {
return self.zFont.cgFont;
}

- (void)setCGFont:(CGFontRef)font {
if (self.zFont.cgFont != font) {
self.zFont = [ZFont fontWithCGFont:font size:self.zFont.pointSize];
}
}

- (CGFloat)pointSize {
return self.zFont.pointSize;
}

- (void)setPointSize:(CGFloat)pointSize {
if (self.zFont.pointSize != pointSize) {
self.zFont = [ZFont fontWithCGFont:self.zFont.cgFont size:pointSize];
}
}

- (void)setZAttributedText:(ZAttributedString *)attStr {
if (zAttributedText != attStr) {
[zAttributedText release];
zAttributedText = [attStr copy];
[self setNeedsDisplay];
}
}

- (void)drawTextInRect:(CGRect)rect {
if (self.zFont == NULL && self.zAttributedText == nil) {
[super drawTextInRect:rect];
return;
}

if (self.zAttributedText == nil) {
// this method is documented as setting the text color for us, but that doesn't appear to be the case
if (self.highlighted) {
[(self.highlightedTextColor ?: [UIColor whiteColor]) setFill];
} else {
[(self.textColor ?: [UIColor blackColor]) setFill];
}

ZFont *actualFont = self.zFont;
CGSize origSize = rect.size;
if (self.numberOfLines == 1) {
origSize.height = actualFont.leading;
CGPoint point = CGPointMake(rect.origin.x,
rect.origin.y + roundf(((rect.size.height - actualFont.leading) / 2.0f)));
CGSize size = [self.text sizeWithZFont:actualFont];
if (self.adjustsFontSizeToFitWidth && self.minimumFontSize < actualFont.pointSize) {
if (size.width > origSize.width) {
CGFloat desiredRatio = (origSize.width * actualFont.ratio) / size.width;
CGFloat desiredPointSize = desiredRatio * actualFont.pointSize / actualFont.ratio;
actualFont = [actualFont fontWithSize:MAX(MAX(desiredPointSize, self.minimumFontSize), 1.0f)];
size = [self.text sizeWithZFont:actualFont];
}
if (!CGSizeEqualToSize(origSize, size)) {
switch (self.baselineAdjustment) {
case UIBaselineAdjustmentAlignCenters:
point.y += roundf((origSize.height - size.height) / 2.0f);
break;
case UIBaselineAdjustmentAlignBaselines:
point.y += (self.zFont.ascender - actualFont.ascender);
break;
case UIBaselineAdjustmentNone:
break;
}
}
}
size.width = MIN(size.width, origSize.width);
// adjust the point for alignment
switch (self.textAlignment) {
case UITextAlignmentLeft:
break;
case UITextAlignmentCenter:
point.x += (origSize.width - size.width) / 2.0f;
break;
case UITextAlignmentRight:
point.x += origSize.width - size.width;
break;
}
[self.text drawAtPoint:point forWidth:size.width withZFont:actualFont lineBreakMode:self.lineBreakMode];
} else {
CGSize size = [self.text sizeWithZFont:actualFont constrainedToSize:origSize lineBreakMode:self.lineBreakMode numberOfLines:self.numberOfLines];
CGPoint point = rect.origin;
point.y += roundf((rect.size.height - size.height) / 2.0f);
rect = (CGRect){point, CGSizeMake(rect.size.width, size.height)};
[self.text drawInRect:rect withZFont:actualFont lineBreakMode:self.lineBreakMode alignment:self.textAlignment numberOfLines:self.numberOfLines];
}
} else {
ZAttributedString *attStr = self.zAttributedText;
if (self.highlighted) {
// modify the string to change the base color
ZMutableAttributedString *mutStr = [[attStr mutableCopy] autorelease];
NSRange activeRange = NSMakeRange(0, attStr.length);
while (activeRange.length > 0) {
NSRange effective;
UIColor *color = [attStr attribute:ZForegroundColorAttributeName atIndex:activeRange.location
longestEffectiveRange:&effective inRange:activeRange];
if (color == nil) {
[mutStr addAttribute:ZForegroundColorAttributeName value:[UIColor whiteColor] range:effective];
}
activeRange.location += effective.length, activeRange.length -= effective.length;
}
attStr = mutStr;
}
CGSize size = [attStr sizeConstrainedToSize:rect.size lineBreakMode:self.lineBreakMode numberOfLines:self.numberOfLines];
CGPoint point = rect.origin;
point.y += roundf((rect.size.height - size.height) / 2.0f);
rect = (CGRect){point, CGSizeMake(rect.size.width, size.height)};
[attStr drawInRect:rect withLineBreakMode:self.lineBreakMode alignment:self.textAlignment numberOfLines:self.numberOfLines];
}
}

- (CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines {
if (self.zFont == NULL && self.zAttributedText == nil) {
return [super textRectForBounds:bounds limitedToNumberOfLines:numberOfLines];
}

if (numberOfLines == 1) {
// if numberOfLines == 1 we need to use the version that converts spaces
CGSize size;
if (self.zAttributedText == nil) {
size = [self.text sizeWithZFont:self.zFont];
} else {
size = [self.zAttributedText size];
}
bounds.size.width = MIN(bounds.size.width, size.width);
bounds.size.height = MIN(bounds.size.height, size.height);
} else {
if (numberOfLines > 0) bounds.size.height = MIN(bounds.size.height, self.zFont.leading * numberOfLines);
if (self.zAttributedText == nil) {
bounds.size = [self.text sizeWithZFont:self.zFont constrainedToSize:bounds.size lineBreakMode:self.lineBreakMode];
} else {
bounds.size = [self.zAttributedText sizeConstrainedToSize:bounds.size lineBreakMode:self.lineBreakMode];
}
}
return bounds;
}

- (void)dealloc {
[zFont release];
[zAttributedText release];
[super dealloc];
}
@end

generated by cgit-pink 1.4.1 (git 2.36.1) at 2025-04-19 12:10:15 +0000