Ejemplo n.º 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);
				}
			}
		}
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 6
0
 public static CGSize StringSize(this string This, UIFont font)
 {
     using (var self = ((NSString)This))
         return(self.StringSize(font));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 8
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font)
 {
     using (var self = ((NSString)This))
         return(self.DrawString(rect, font));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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))
 {
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 15
0
 public static CGSize StringSize(this string This, UIFont font)
 {
     using (var self = ((NSString) This))
         return self.StringSize (font);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 17
0
 public static CGSize DrawString(this string This, CGRect rect, UIFont font)
 {
     using (var self = ((NSString) This))
         return self.DrawString (rect, font);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
 }