- Company: Bohemian Coding
- Duration: 6 months, part-time
I re-implemented the preview panes for Fontcase 2.1, which display side-by-side previews of short sentences/paragraphs in different fonts.
I optimised the panes to have the ability of displaying previews for collections consisting of anywhere up to thousands of fonts in an efficient way without affecting regular user interaction, such as smooth scrolling. This was achieved through such methods as caching, using operation queues and GCD and lazy-loading of font descriptors.
Since the rows in the list of previews were fitted to each font preview, the custom list control was able to resize individual rows as new font previews were loaded.
My implementation uses the Cocoa text system heavily, which made drawing previews efficient and also allowed easier implementation of features such as the font previews acting normally as regular text but also text fields when clicked on, so their content could be edited.
Open Source Projects
These are a collection of my Objective-C/Cocoa open source projects. Source code and more information for these projects can be found on my GitHub page.
A view-based list control for OS X 10.6 and up, with similar optimisations as UITableView in iOS such as cell reuse.
PXListView is used in apps including Sketch 2, the Apple Design Award-winning app from Bohemian Coding.
A hierarchical navigation bar UI control for OS X, similar to the control used in the podcasts window in iTunes.
A controller class for iOS which makes configuring table views with static content easier.
- Type: Group Project (2 members)
- Duration: 7 weeks
- Language: C++ (with use of the STL and some C++ 11 features).
- Platform: Tested by the department on Linux. However, we mainly built the project on Windows and OS X.
MAlice is a language that our department devised for use in this project, resembling nonsense literature and inspired by Alice in Wonderland. Our task was to build a compiler taking MAlice source programs and output executable code.
Lexer and Parser
- We built the lexer and parser for our compiler using ANTLR, mainly for its powerful debugging GUI.
- Our ANTLR grammar includes syntactic predicates and also defines the structure of our AST from the input tokens, which means our AST can be built up during parsing.
- We manipulate a stack of symbol tables as we enter and exit scope for the program when we walk over the AST.
- At any position during our pass over the AST, the symbol table stack contains information about all entities which are currently in scope (we take advantage of the fact that MAlice doesn't allow forward declarations of functions or global variables).
- I wrote a lot of the code which emits error messages when we encounter validation errors, and the style of error message is heavily inspired by clang.
- The project spec instructed us to output assembly code before running a tool to generate machine code. We chose to output LLVM IR.
- We used the LLVM C++ libraries to aid us with this. I implemented most of the code-generation for nodes in our AST which gave me experience with working with the LLVM libraries.