osx-snow-leopard

How can you load a font (TTF) from a file using Core Text?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 00:00:00
Prior to OSX 10.6, ATSFontActivateFromFileSpecification/ATSFontActivateFromFileReference were available and could be used to load a font from a file. I can't find anything similar in Core Text. Rob Keniger You can get a CTFontRef from a font file by going via a CGFontRef : CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/path/to/font"), kCFURLPOSIXPathStyle, false); CGDataProviderRef dataProvider = CGDataProviderCreateWithURL(url); CGFontRef theCGFont = CGFontCreateWithDataProvider(dataProvider); CTFontRef theCTFont = CTFontCreateWithGraphicsFont(theCGFont); CFRelease

Macports mysql5 setup under Snow Leopard

爷,独闯天下 提交于 2019-11-29 23:13:19
I've managed to get my install all screwed up as I'm a newbie and messing up is what I'm good at. 1) Can anyone reference a credible set of setup instructions for this stuff? 2) Can I just uninstall and start from scratch (passwords and all) through macports? I tried and a bunch of mysql directories stuck around after the unistall, WTF!? 3) Where does mysqld.sock need to reside and what file settings do I need to apply to get it playing nice with php5 and apache2 ? Does it live in /tmp or in /opt/local/var/run/mysql5/ ? Do I need to configure /opt/local/etc/php5/php.ini? opt/local/var/db/php5

Xcode 4.2 + c++0x/libc++ cannot find iostream

a 夏天 提交于 2019-11-29 22:14:49
问题 I'm using Macbook 1g, Snow Leopard. Few days ago i installed xcode 4.2 and made a test project for c++0x. I set LLVM 3.0 as c++ compiler, C++ Language Dialect as C++0x and C++ Standard Library as libc++. but when building, error occured. "iostream" file not found I find it most bewildering. How can I solve this problem? 回答1: "I changed libc++ to libstdc++". How? Where is this setting? Apple documentation says "simply set "C++ Standard Library Type" in the build settings to ... " Build

Creating an IMP from an Objective-C block

淺唱寂寞╮ 提交于 2019-11-29 21:47:38
The IMP type in Objective-C represents a function pointer, as far I as understand. Is there any way to make an IMP from a block pointer? Thanks for your ideas. Since this was written there is now API in iOS and Mac OS X that allows Blocks to be turned into IMPs directly. I wrote up a weblog post describing the API (imp_implementationWithBlock()). A block is effectively a structure that contains a bit of metadata, a reference to the code contained within the block and a copy of the const-copied data captured within the block. Thus, no, there is no way to directly map between an IMP and a Block

Where to get macos SDK 10.6 for Xcode?

回眸只為那壹抹淺笑 提交于 2019-11-29 20:28:59
I am having Xcode 4.4 on OS X Lion. I'd like to install the Mac 10.6 SDK - also known as macosx10.7 SDK - because I need to compile openFrameworks. I found that I need to download additional tools from this site . However I didn't find any 10.6 SDK there. I also tried looking in Xcode Preferences -> Downloads -> Components, but there is no way. I am wondering how can I install previous SDKs for Xcode? Rob Napier Unfortunately, Apple tends to make this much harder than you'd like. You can't download SDKs by themselves. They come as part of specific versions of Xcode. So you have to download the

Downloading MacPorts dependencies without installing

左心房为你撑大大i 提交于 2019-11-29 18:53:00
问题 The default MacPorts installation downloads each dependency, builds and installs it, then downloads, builds and installs the next dependency, and so on. This means that a constant network connection is required throughout the installation. In my configuration, a constant network connection is not feasible. This means that installation of a large-dependency package can take a very long time. How do I download all dependencies for a specified MacPorts package at the beginning (while connected

rails - postgres error: Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later,

痴心易碎 提交于 2019-11-29 18:07:00
问题 I am stuck with the setup of Ruby (1.9.3), Rails and Postgres (9.0.8) on my Mac (10.6.8). Everytime when I run rails console I get the following error: /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg.rb:4:in `require': dlopen(/Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg_ext.bundle, 9): Library not loaded: @loader_path/../lib/libssl.dylib (LoadError) Referenced from: /usr/lib/libpq.5.dylib Reason: Incompatible library version: libpq.5.dylib requires version

batch processing pandoc conversions

自作多情 提交于 2019-11-29 12:42:59
问题 Sorry or being thick. I've searched high and low to try and work out how to batch process pandoc. I cannot for the life of me work it out. How do I convert a folder and nested folders containing html files to markdown? I should mention that I'm using os x 10.6.8 回答1: You can apply any command across the files in a directory tree using find : find . -name \*.md -type f -exec pandoc -o {}.txt {} \; would run pandoc on all files with a .md suffix, creating a file with a .md.txt suffix. (You will

How to detect global mouse button events [closed]

做~自己de王妃 提交于 2019-11-29 12:02:58
I'm wondering how can I write a code to monitor the mouse buttons globally. This would be for OS X, and I'd like to try writing it in Qt/C++. To begin with I don't know how to capture those global events. The monitor application would not display a GUI, it'd simply be a process that runs in the background and detects mouse buttons being clicked. In the second part of the program I would like to launch hot-keys depending of the mouse key pressed. My final idea is make a free program like steerMouse, just to figure out how it could be done. I'm asking for a guidance of where to start - how can I

How do you fix an SVN 409 Conflict Error

痴心易碎 提交于 2019-11-29 07:40:31
问题 I used to use SVN 1.4 on OS X Leopard and everything was fine. A couple of weeks ago I installed a fresh copy of OS X 10.6. The version of SVN that comes with Snow Leopard is 1.6.5. I went ahead and built my own copy with 1.6.6. I'm using the built in apache server and just hosting repositories locally. Everything appeared to work fine until I actually tried to commit something. Everytime I try to commit a change, I get the following message: Transmitting file data .svn: Commit failed