QuickLook: Handle thumbnail generation

Read at most 1 KiB or 50 lines of a file and render the attributed string in a bitmap context.

The theme is set to Mac Classic to ensure a white background for best look when the previews are used as icons in Finder.

The user’s default fixed width font in size 4 is used. With this font size only around 7 lines are shown, so we need to make it smaller, but we probably want to scale down the result to allow fractional line heights.

A lot of code is copy/pasted from the QuickLook preview generator.
This commit is contained in:
Nyx0uf
2014-07-10 13:57:52 +02:00
committed by Allan Odgaard
parent 6172d9ae8f
commit 3f716c27ad
3 changed files with 111 additions and 9 deletions

View File

@@ -47,5 +47,11 @@
</array>
</dict>
</array>
<key>QLThumbnailMinimumSize</key>
<integer>32</integer>
<key>QLSupportsConcurrentRequests</key>
<true/>
<key>QLNeedsToBeRunInMainThread</key>
<false/>
</dict>
</plist>