コード例 #1
0
		public unsafe void ShowCGGlyphs (
			short[] /* const CGGlyph* = CGFontIndex* = unsigned short* */ glyphs,
			CGPoint[] /* const CGPoint* */ positions,
			nuint /* NSUInteger */ glyphCount,
			UIFont font,
			CGAffineTransform textMatrix,
			NSDictionary attributes,
			CGContext graphicsContext)
		{
			fixed (short* gl = glyphs) {
				fixed (CGPoint* pos = positions) {
					ShowCGGlyphsInternal ((IntPtr) gl, (IntPtr) pos, glyphCount, font, textMatrix, attributes, graphicsContext);
				}
			}
		}
コード例 #2
0
        internal UITextAttributes(NSDictionary dict)
        {
            if (dict == null)
                return;

            NSObject val;

            if (dict.TryGetValue (UITextAttributesConstants.Font, out val))
                Font = val as UIFont;
            if (dict.TryGetValue (UITextAttributesConstants.TextColor, out val))
                TextColor = val as UIColor;
            if (dict.TryGetValue (UITextAttributesConstants.TextShadowColor, out val))
                TextShadowColor = val as UIColor;
            if (dict.TryGetValue (UITextAttributesConstants.TextShadowOffset, out val)) {
                var value = val as NSValue;
                if (value != null)
                    TextShadowOffset = value.UIOffsetValue;
            }
        }
コード例 #3
0
 public static CGSize DrawString(this string This, CGPoint point, global::System.nfloat width, UIFont font, UILineBreakMode breakMode)
 {
     using (var self = ((NSString)This))
         return(self.DrawString(point, width, font, breakMode));
 }
コード例 #4
0
 public static CGSize StringSize(this string This, UIFont font, CGSize constrainedToSize, UILineBreakMode lineBreakMode)
 {
     using (var self = ((NSString)This))
         return(self.StringSize(font, constrainedToSize, lineBreakMode));
 }
コード例 #5
0
 public static CGSize StringSize(this string This, UIFont font, global::System.nfloat minFontSize, ref global::System.nfloat actualFontSize, global::System.nfloat forWidth, UILineBreakMode lineBreakMode)
 {
     using (var self = ((NSString)This))
         return(self.StringSize(font, minFontSize, ref actualFontSize, forWidth, lineBreakMode));
 }
コード例 #6
0
 public static CGSize StringSize(this string This, UIFont font)
 {
     using (var self = ((NSString)This))
         return(self.StringSize(font));
 }
コード例 #7
0
 public static CGSize StringSize(this string This, UIFont font, global::System.nfloat forWidth, UILineBreakMode breakMode)
 {
     using (var self = ((NSString)This))
         return(self.StringSize(font, forWidth, breakMode));
 }
コード例 #8
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font)
 {
     using (var self = ((NSString)This))
         return(self.DrawString(rect, font));
 }
コード例 #9
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font, UILineBreakMode mode, UITextAlignment alignment)
 {
     using (var self = ((NSString)This))
         return(self.DrawString(rect, font, mode, alignment));
 }
コード例 #10
0
 public NSAttributedString(string str,
     UIFont font = null,
     UIColor foregroundColor = null,
     UIColor backgroundColor = null,
     UIColor strokeColor = null,
     NSParagraphStyle paragraphStyle = null,
     NSLigatureType ligatures = NSLigatureType.Default,
     float kerning = 0,
     NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
     NSShadow shadow = null,
     float strokeWidth = 0,
     NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None)
     : this(str, ToDictionary (font, foregroundColor, backgroundColor, strokeColor, paragraphStyle, ligatures, kerning, underlineStyle, shadow, strokeWidth, strikethroughStyle))
 {
 }
コード例 #11
0
 public static CGSize DrawString(this string This, CGPoint point, global::System.nfloat width, UIFont font, UILineBreakMode breakMode)
 {
     using (var self = ((NSString) This))
         return self.DrawString (point, width, font, breakMode);
 }
コード例 #12
0
 public static CGSize StringSize(this string This, UIFont font, CGSize constrainedToSize, UILineBreakMode lineBreakMode)
 {
     using (var self = ((NSString) This))
         return self.StringSize (font, constrainedToSize, lineBreakMode);
 }
コード例 #13
0
 public static CGSize StringSize(this string This, UIFont font, global::System.nfloat minFontSize, ref global::System.nfloat actualFontSize, global::System.nfloat forWidth, UILineBreakMode lineBreakMode)
 {
     using (var self = ((NSString) This))
         return self.StringSize (font, minFontSize, ref actualFontSize, forWidth, lineBreakMode);
 }
コード例 #14
0
 public static CGSize StringSize(this string This, UIFont font, global::System.nfloat forWidth, UILineBreakMode breakMode)
 {
     using (var self = ((NSString) This))
         return self.StringSize (font, forWidth, breakMode);
 }
コード例 #15
0
 public static CGSize StringSize(this string This, UIFont font)
 {
     using (var self = ((NSString) This))
         return self.StringSize (font);
 }
コード例 #16
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font, UILineBreakMode mode, UITextAlignment alignment)
 {
     using (var self = ((NSString) This))
         return self.DrawString (rect, font, mode, alignment);
 }
コード例 #17
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font)
 {
     using (var self = ((NSString) This))
         return self.DrawString (rect, font);
 }
コード例 #18
0
 public static CGSize DrawString(this string This, CGPoint point, global::System.nfloat width, UIFont font, global::System.nfloat minFontSize, ref global::System.nfloat actualFontSize, UILineBreakMode breakMode, UIBaselineAdjustment adjustment)
 {
     using (var self = ((NSString) This))
         return self.DrawString (point, width, font, minFontSize, ref actualFontSize, breakMode, adjustment);
 }
コード例 #19
0
 internal static NSDictionary ToDictionary(
     UIFont font,
     UIColor foregroundColor,
     UIColor backgroundColor,
     UIColor strokeColor,
     NSParagraphStyle paragraphStyle,
     NSLigatureType ligature,
     float kerning,
     NSUnderlineStyle underlineStyle,
     NSShadow shadow,
     float strokeWidth,
     NSUnderlineStyle strikethroughStyle)
 {
     var attr = new UIStringAttributes ();
     if (font != null){
         attr.Font = font;
     }
     if (foregroundColor != null){
         attr.ForegroundColor = foregroundColor;
     }
     if (backgroundColor != null){
         attr.BackgroundColor = backgroundColor;
     }
     if (strokeColor != null){
         attr.StrokeColor = strokeColor;
     }
     if (paragraphStyle != null){
         attr.ParagraphStyle = paragraphStyle;
     }
     if (ligature != NSLigatureType.Default){
         attr.Ligature = ligature;
     }
     if (kerning != 0){
         attr.KerningAdjustment = kerning;
     }
     if (underlineStyle != NSUnderlineStyle.None){
         attr.UnderlineStyle = underlineStyle;
     }
     if (shadow != null){
         attr.Shadow = shadow;
     }
     if (strokeWidth != 0){
         attr.StrokeWidth = strokeWidth;
     }
     if (strikethroughStyle != NSUnderlineStyle.None){
         attr.StrikethroughStyle = strikethroughStyle;
     }
     var dict = attr.Dictionary;
     return dict.Count == 0 ? null : dict;
 }
コード例 #20
0
 public static CGSize DrawString(this string This, CGPoint point, global::System.nfloat width, UIFont font, global::System.nfloat minFontSize, ref global::System.nfloat actualFontSize, UILineBreakMode breakMode, UIBaselineAdjustment adjustment)
 {
     using (var self = ((NSString)This))
         return(self.DrawString(point, width, font, minFontSize, ref actualFontSize, breakMode, adjustment));
 }