//====== private static methods

        private static void DrawRectangle(TextCanvas canvas, Rectangle rect, bool isFrame)
        {
            if (rect.Size.HasNoArea)
            {
                return;
            }

            var backColor = isFrame ? Color16.White : Color16.Black;

            var cell = new TextCell(' ', Color16.Black, backColor);

            canvas.HLine(rect.TopLeft, rect.Size.Width, cell);
            canvas.HLine(rect.BottomLeft, rect.Size.Width, cell);

            canvas.VLine(rect.TopLeft, rect.Size.Height, cell);
            canvas.VLine(rect.TopRight, rect.Size.Height, cell);
        }