# Styles

## IBlockStyle

IBlockStyle has 3 parts:

- Name (style name, used for identification)
- 3 Canvas objects (LineStyleInfo, FillStyleInfo, FontStyleInfo)
- many shortcuts to some properties of LineStyleInfo, FillStyleInfo, FontStyleInfo

We wanted to make the actual 3 Canvas objects private, to abstract the BlockStyle clients from the Canvas library, but its clients (Layouts) seem to need LineStyleInfo to draw on a Renderer.

So another question now is: if the 3 Canvas objects are anyway public, do we need the shortcuts at all? For example, instead of using a shortcut Style.LineWidth we could directly write Style.LineStyleInfo.Width.

Shortcuts are more flexible (what if we change the 3 Canvas objects?), and easier to use (see example above), but how big is the chance that they will change?

## BlockStyle

BlockStyle implements IBlockStyle.

## StyleFactory

AddStyle adds a style object to the internal hashtable, GetStyle retrieves a style by name or null in case name not found.