title: Setting line spacing in a CTFrame
body: <p>I'm working in a kind of QR Code generator, it's a Mac app.
  I know how draw the text, but I don't know how I can set line spacing.</p>
  
  <p>My code:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>// Prepare font
      CTFontRef font = CTFontCreateWithName(CFSTR("LucidaSansUnicode"), 16, NULL);
  
      // Create Path
      CGMutablePathRef gpath = CGPathCreateMutable();
      CGPathAddRect(gpath, NULL, CGRectMake(10, 0, pixelsWidth, pixelsHigh));
  
      CGContextSetTextDrawingMode (newcontext, kCGTextFill); 
      CGContextSetGrayFillColor(newcontext, 0.0, 1.0);
  
      // Create an attributed string
      CFStringRef keys[] = { kCTFontAttributeName };
      CFTypeRef values[] = { font };
      CFDictionaryRef attr = CFDictionaryCreate(NULL, (const void **)&amp;keys, (const void **)&amp;values,
                                                sizeof(keys) / sizeof(keys[0]), &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
      CFAttributedStringRef attrString = CFAttributedStringCreate(NULL, stringCode, attr);
      CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)attrString);
  
      CTFrameRef theFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, CFAttributedStringGetLength(attrString)), gpath, NULL); 
  
      // Draw the string
      CTFrameDraw(theFrame, newcontext);
  </code></pre>
  
  <p>I have been searching but I don't find anything. Maybe must I use CTLine?</p>
  
  <p>Update:</p>
  
  <p>Okay, I found this but it don't solve my problem, I want less than 0.0point of line spacing.
  </p>
  
  <pre><code>CTTextAlignment paragraphAlignment = kCTLeftTextAlignment;
  
      CGFloat maxLine = 0.0;
  
      CTParagraphStyleSetting setting[2] = {
          {kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &amp;paragraphAlignment},
          {kCTParagraphStyleSpecifierLineSpacingAdjustment, sizeof(CGFloat), &amp;maxLine}
      };
  
      CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(setting, 2);
  </code></pre>