Unicode Text Processing

Design & Implementation of a Win32 Text Editor

The last tutorial presented an overview of the various encoding formats that are used to store Unicode text. It is now time to take this theory and apply it to Neatpad. Therefore the subject of this article will be Unicode text processing.

The image above shows Neatpad's new Encoding menu option - with a UTF-8 file displayed in all it's glory. At the top of this tutorial are a collection of Unicode files which you can use to test Neatpad's Unicode capability.

Introduction to Unicode

Design & Implementation of a Win32 Text Editor

The user-interface for the TextView has progressed enough to allow us to switch our attention back to the TextDocument. I am now concentrating on adding full Unicode support to Neatpad. Because Unicode is such a complicated subject I won't attempt to tackle it all at once so instead I will split the various aspects of Unicode across several tutorials.

Margins and Long Lines

Design & Implementation of a Win32 Text Editor

This will probably be quite a short tutorial as the subject of margins is really quite simple to implement. This time around we will look at implementing a selection margin (complete with full-line selection), line numbers, line-indicator icons (e.g. like the breakpoint bitmaps in Visual Studio), and lastly the problem of long-line display.

Scrolling with the Mouse

Design & Implementation of a Win32 Text Editor

Originally I had planned to keep all of the mouse-related concepts together in one tutorial. The problem is, does mouse-scrolling belong in the mouse tutorial (part#5) or the scrolling tutorial (part#3)? In the end I've decided to make it a separate topic by itself. Actually it has worked quite well because it gives a good sense of progression between basic mouse selection (with no scrolling) and a fully working selectable, scrollable control.

Mouse Selection & Highlighting

Design & Implementation of a Win32 Text Editor

Mouse input has proven to be the most intricate and difficult to write part of Neatpad to date. It hasn't been helped by the fact that Neatpad now supports variable-width fonts, so in some ways I am still unsure if this extra complexity is a good thing or not (from a tutorial / learning point of view). However, if I had stuck with fixed-width fonts it would be quite a task for anyone to move from that limited capability to a fully variable-width display, so from that perspective I think I made the right decision...

Enhanced Drawing & Painting

Design & Implementation of a Win32 Text Editor

Welcome to the fourth installment of the "Design and Implementation of a Win32 Text Editor" article series! I realise that you were probably expecting a different tutorial this time around. However, it was only after starting to implement mouse selection and highlighting that I realised there wasn't proper support in the drawing "engine". I've decided to implement all of my text-output requirements in this one tutorial. So we will be covering tabbed-output, multi-coloured text (i.e. for syntax highlighting and selection highlighting) and the problem of ASCII control characters.

Design & Implementation of a Win32 Text Editor

Neatpad Text Editor


Welcome to the brand new tutorial series - "Design and Implementation of a Win32 Text Editor!"

The purpose of these tutorials is to follow the development of a win32 text editor - codenamed Neatpad. Each tutorial will take you step-by-step over the major components and design decisions that lay ahead.


Subscribe to RSS - editor