I have merged into the trunk the fonts branch where I was developing a new text layout engine. This provides an overload to FontSurface.DrawText which takes arguments like (string formatString, params object[] args), in a manner similar to string.Format, Console.WriteLine, or Debug.Print. This adds some special AgateLib specific features like being able to do:
As usual, where the "{0}" argument is substituted the 0-th object in the args array, however if that object is a Surface as in the above example, it will be drawn inline with the text. There are other special objects that can be inserted too. These inherit from the AlterText object, and can be used like so:
The above code will cause the text "is green" to be colored green. There are some breaking changes in this update, in particular the characters { and } must be escaped by surrounding them in braces, e.g. {{} and {}}. With this update also comes stateless drawing. Now the "impl" objects for surfaces and fonts do not track any state data. SurfaceImpl now only has one Draw method which takes a SurfaceState object. This greatly simplifies the implementation and maintenance of display drivers and also adds the ability to draw images with cached states. This is a major change in the interal structure of AgateLib and its drivers, so there may be regressions. Please report any issues so they can be fixed. |
|||
|
|

wow
that's a great feature. I wish I had the time resources to seriously develop with this library. Great job.