Chapter 1. Getting Started withPaths and Text

In this chapter, we will cover:

  • Drawing a line
  • Drawing an arc
  • Drawing a Quadratic curve
  • Drawing a Bezier curve
  • Drawing a zigzag
  • Drawing a spiral
  • Working with text
  • Drawing 3D text with shadows
  • Unlocking the power of fractals: Drawing a haunted tree

Introduction

This chapter is designed to demonstrate the fundamental capabilities of the HTML5 canvas by providing a series of progressively complex tasks. The HTML5 canvas API provides the basic tools necessary to draw and style different types of sub paths including lines, arcs, Quadratic curves, and Bezier curves, as well as a means for creating paths by connecting sub paths. The API also provides great support for text drawing with several styling properties. Let's ...

Get HTML5 Canvas Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.