Posts Tagged ‘OS X’

Sub-pixel rendering in Mac OS X

Wednesday, May 5th, 2010

In OS X Snow Leopard, Apple changed the Appearances preferences so that you could either enable sub-pixel rendering (”font smoothing”) when available (i.e. if it detects that you are using an LCD monitor), or completely disable it. However, it can be a bit buggy, and often incorrectly recognises your LCD monitor as a CRT, thereby disabling sub-pixel rendering for fonts in newly started applications. Aside from the fact that it makes one’s eyes bleed, it’s also extremely irritating when half of your applications have sub-pixel rendering enabled – and the other half don’t. Let me give you an example:

With sub-pixel rendering enabled

Without sub-pixel rendering enabled

Without sub-pixel rendering enabled

Not nice. Fortunately the fix isn’t too hard; a single command in Terminal:

defaults -currentHost write -globalDomain AppleFontSmoothing -int 2

This command simply tells OS X to always use medium sub-pixel rendering, whether or not it thinks it is available. It’s fairly safe to just “set and forget”, as people very rarely use CRTs. Hopefully Apple will fix this bug properly, however, and this hack will no longer be needed.

Issues with C++ strings in OS X’s standard library

Monday, February 22nd, 2010

It seems that someone at Apple has turned on _GLIBCXX_FULLY_DYNAMIC_STRING in such a way that it is breaking _GLIBCXX_DEBUG builds. This means that (with some Xcode/GCC/OS X versions) if you try to use strings from the C++ standard library without enabling the _GLIBXX_FULLY_DYNAMIC_STRING preprocessor macro, your debug builds will have a runtime error similar to the following:

malloc: * error for object 0x10000a720: pointer being freed was
    not allocated * set a breakpoint in malloc_error_break to debug

In order to solve this issue from Xcode, you need to modify your build target information. Double-click your build target from the ‘Targets’ drop-down list in the left-hand column, navigate to the build tab, then scroll down to the ‘GCC – Preprocessing’ area, and enable fully dynamic strings by adding a new macro to the ‘Preprocessor Macros’ list: _GLIBCXX_FULLY_DYNAMIC_STRING=1

Feel free to leave a comment if you have any extra information on the issue (including fixes in newer versions/etc/etc).

References:
http://stackoverflow.com/questions/2234557/c-using-stdgetline-prints-pointer-being-freed-was-not-allocated
http://lists.apple.com/archives/cocoa-dev/2009/Sep/msg01199.html

Olympus E-P1 and my next computer.

Friday, June 19th, 2009

The Olympus E-P1 looks absolutely stunning. It’s highly likely that I’ll be buying one of those come September.

The E-P1 does away with the mirror box of D-SLRs, whilst retaining a large Micro Four Thirds sized sensor, which results in a camera which isn’t really an SLR, but produces high quality images akin to those typical of D-SLRs. It seems to be an ideal camera for street photography – the silver model isn’t overly obtrusive, and coupled with the 17mm lens and optical viewfinder (fitted onto the hot-shoe), makes for a compact camera capable of taking high-quality images whilst still being small enough to not be highly noticeable. It is quite expensive, at £749.99 for the kit including the 17mm lens and optical viewfinder, but I feel that it is well worth it, and there won’t be many (if any) running costs involved – no film to develop and scan. As well as this, Olympus will be producing an adaptor which will allow me to use my OM lenses from my OM-2n on the E-P1, which is a great benefit. I will be waiting until reviews are available on the camera before making a final decision, but I’m almost certain that it is the camera for me.

I have also been looking into the 13″ MacBook Pro, and believe that come September, I will have enough money to purchase a model. I’m willing to accept the lower resolution of the 13″ model due to the extra portability offered, especially as I am also planning to purchase the 24″ Apple Cinema Display to go with it, which runs at 1920×1200. An expensive investment, but well worth it I feel. The MacBook Pro comes with an SDHC card-reader, which will be extremely useful when coupled with the aforementioned Olympus E-P1, which also uses SDHC cards – that’s one less cable for me to worry about! It is highly likely that I will purchase Aperture with the MacBook, and use that for photo management. I’ve looked into Lightroom as well, but it seems from reviews that Aperture is more suited to my needs. Furthermore, Macs provide an ideal environment for doing development work in, especially as they are Unix-based, and thus have a half-decent shell available to users. I’ll most likely be using Eclipse for Java programming, and I’ll possibly be doing some Qt development on Macs as well, but we shall see.