/*!
Function for drawing filled rectangle in document

\param params
181565
function callFilledRectangle( $info )
    {
        $params = array();

        eZPDFTable::extractParameters( $info['p'], 0, $params, true );

        $keyArray = array ( 'c', 'm', 'y', 'k' );
        $cmykTop = explode( ',', $params['cmykTop'] );
        $cmykBottom = explode( ',', $params['cmykBottom'] );

        foreach ( array_keys( $cmykBottom ) as $key )
        {
            $cmykBottom[$keyArray[$key]] = $cmykBottom[$key];
            unset( $cmykBottom[$key] );
            $cmykTop[$keyArray[$key]] = $cmykTop[$key];
            unset( $cmykTop[$key] );
        }

        $this->ezShadedRectangle( $params['x'], $params['y'], $params['width'], $params['height'], $cmykTop, $cmykBottom );
    }
951362
def draw_rectangle(x, y, width, height)
      @context.drawRect(x, y, width, height)
    end
1027802
function Rect(options) {

    var self = this;
    this.paper = options.paper;
    this.manager = options.manager;

    if (options.id) {
        this._id = options.id;
    } else {
        this._id = this.manager.getRandomId();
    }
    this._x = options.x;
    this._y = options.y;
    this._width = options.width;
    this._height = options.height;
    this._strokeColor = options.strokeColor;
    this._strokeWidth = options.strokeWidth || 2;
    this._selected = false;
    this._zoomFraction = 1;
    if (options.zoom) {
        this._zoomFraction = options.zoom / 100;
    }
    this.handle_wh = 6;

    this.element = this.paper.rect();
    this.element.attr({'fill-opacity': 0.01,
                       'fill': '#fff',
                       'cursor': 'pointer'});

    if (this.manager.canEdit) {
        // Drag handling of element
        this.element.drag(
            function(dx, dy) {
                // DRAG, update location and redraw
                dx = dx / self._zoomFraction;
                dy = dy / self._zoomFraction;

                var offsetX = dx - this.prevX;
                var offsetY = dy - this.prevY;
                this.prevX = dx;
                this.prevY = dy;

                // Manager handles move and redraw
                self.manager.moveSelectedShapes(offsetX, offsetY, true);
            },
            function() {
                self._handleMousedown();
                this.prevX = 0;
                this.prevY = 0;
                return false;
            },
            function() {
                // STOP
                // notify manager if rectangle has moved
                if (this.prevX !== 0 || this.prevY !== 0) {
                    self.manager.notifySelectedShapesChanged();
                }
                return false;
            }
        );
    }

    this.createHandles();

    this.drawShape();
}
385873
function ezText( $text, $size = 0, $options = array(), $test = 0 )
    {
        // this will add a string of text to the document, starting at the current drawing
        // position.
        // it will wrap to keep within the margins, including optional offsets from the left
        // and the right, if $size is not specified, then it will be the last one used, or
        // the default value (12 I think).
        // the text will go to the start of the next line when a return code "\n" is found.
        // possible options are:
        // 'left'=> number, gap to leave from the left margin
        // 'right'=> number, gap to leave from the right margin
        // 'aleft'=> number, absolute left position (overrides 'left')
        // 'aright'=> number, absolute right position (overrides 'right')
        // 'justification' => 'left','right','center','centre','full'
        // 'top_margin' => set top margin manualy

        // only set one of the next two items (leading overrides spacing)
        // 'leading' => number, defines the total height taken by the line, independent of the font height.
        // 'spacing' => a real number, though usually set to one of 1, 1.5, 2 (line spacing as used in word processing)

        // if $test is set then this should just check if the text is going to flow onto a new page or not, returning true or false

        // apply the filtering which will make the underlining function.
        if ( strlen( $text ) == 0 )
            return $this->y;

        $text = $this->ezProcessText( $text );

        $newPage = false;
        $store_y = $this->y;
        $left = $angle = $adjust = 0;

        if ( is_array( $options ) && isset( $options['aright'] ) )
        {
            $right = $options['aright'];
        }
        else
        {
            $right = $this->ez['pageWidth'] - $this->rightMargin() - ( ( is_array( $options ) && isset( $options['right'] ) ) ? $options['right'] : 0 );
        }
        if ( $size <= 0 )
        {
            $size = $this->ez['fontSize'];
        }
        else
        {
            $this->ez['fontSize'] = $size;
        }

        if ( is_array( $options ) && isset( $options['top_margin'] ) )
        {
            $this->y = $this->ez['pageHeight'] - $options['top_margin'];
        }

        if ( is_array( $options ) && isset( $options['justification'] ) )
        {
            $just = $options['justification'];
        }
        else
        {
            $just = $this->ez['justification'];
        }

        // modifications to give leading and spacing based on those given by Craig Heydenburg 1/1/02
        if ( is_array( $options ) && isset( $options['leading'] ) )
        { // use leading instead of spacing
            $height = $options['leading'];
        }
        else if ( is_array( $options ) && isset( $options['spacing'] ) )
        {
            $height = $this->getFontHeight( $size ) * $options['spacing'];
        }
        else
        {
            $height = $this->getFontHeight( $size );
        }

        $lastOnlyDirective = false;
        $lines = explode( "\n", $text );
        if ( $text == "\n" )
        {
            $lines = array( "" );
        }
        foreach ( array_keys( $lines ) as $key )
        {
            $line = $lines[$key];
            if ( ( $key > 0 || strlen( $line ) == 0 ) &&
                 !$lastOnlyDirective )
            {
                $this->y = $this->y - $height;
                $this->ez['xOffset'] = 0;
            }
            $lastOnlyDirective = false;
            while ( strlen( $line ) )
            {
                $noClose = 1;
                while ( $noClose )
                {
                    $f = 1;
                    $directiveArray = $this->PRVTcheckTextDirective( $line, 0, $f );
                    $noClose = $directiveArray['noClose'];
                    if ( $noClose )
                    {
                        if ( $this->ez['xOffset'] != 0 )
                        {
                            $left = $this->ez['xOffset'];
                        }
                        else
                        {
                            $left = $this->leftMargin() + ( (is_array( $options ) && isset( $options['left'] ) ) ? $options['left'] : 0 );
                        }

                        $textInfo = $this->addText( $left, $this->y, $size, substr( $line, 0, $directiveArray['directive'] ), $angle, $adjust );
                        $line = substr( $line, $directiveArray['directive'] );
                        if ( isset( $textInfo['width'] ) && $textInfo['width'] != 0 )
                        {
                            $this->setXOffset( $left + $textInfo['width'] );
                        }
                    }
                }

                if ( $this->y < $this->ez['bottomMargin'] )
                {
                    if ( $test )
                    {
                        $newPage = true;
                    }
                    else if ( strlen( trim( $line ) ) )
                    {
                        $this->ezNewPage();
                        // and then re-calc the left and right, in case they have changed due to columns
                    }
                }
                if ( $this->ez['xOffset'] != 0 )
                {
                    $left = $this->ez['xOffset'];
                }
                else
                {
                    $left = $this->leftMargin() + ( ( is_array( $options ) && isset( $options['left'] ) ) ? $options['left'] : 0 );
                }

                if ( is_array( $options ) && isset( $options['aleft'] ) )
                {
                    $left=$options['aleft'];
                }
                if ( is_array( $options ) && isset( $options['aright'] ) )
                {
                    $right = $options['aright'];
                }
                else
                {
                    $right = $this->ez['pageWidth'] - $this->rightMargin() - ( ( is_array( $options ) && isset( $options['right'] ) ) ? $options['right'] : 0 );
                }

                $textInfo = $this->addTextWrap( $left, $this->y, $right - $left, $size, $line, $just, 0, $test );
                if ( isset( $textInfo['only_directive'] ) &&
                     $textInfo['only_directive'] === true )
                {
                    $lastOnlyDirective = true;
                    $line = '';
                    continue;
                }
                $line = $textInfo['text'];
                if ( strlen( $line ) || $textInfo['width'] == 0 )
                {
                    $this->y = $this->y - $height;
                    $this->ez['xOffset'] = 0;
                }
                else if ( $textInfo['width'] != 0 )
                {
                    $this->setXOffset( $left + $textInfo['width'] );
                }
            }
        }

        if ( $test )
        {
            $this->y = $store_y;
            return $newPage;
        }
        else
        {
            return $this->y;
        }
    }
1207673
function process( $mimeData, $parameters = array() )
    {
        $printInfo = false;
        if ( isset( $parameters['print_info'] ) )
            $printInfo = $parameters['print_info'];

        $filename = $mimeData['url'];
        $fd = fopen( $filename, 'rb' );
        if ( $fd )
        {
            $blockTypes = array( 0x21 => 'Exension Introducer',
                                 0x2c => 'Image Descriptor',
                                 0x3b => 'Trailer' );
            $extensionLabels = array( 0xf9 => 'Graphical Control Extension',
                                      0xff => 'Application Extension',
                                      0xfe => 'Comment Extension' );
            // Read GIF header
            $data = fread( $fd, 6 );
            if ( $data == 'GIF87a' or
                 $data == 'GIF89a' )
            {
                $info = array();

                $info['version'] = substr( $data, 3 );
                $info['frame_count'] = 0;
                $info['mode'] = eZImageAnalyzer::MODE_INDEXED;
                $offset = 6;

                $info['animation_timer'] = false;
                $info['animation_timer_type'] = eZImageAnalyzer::TIMER_HUNDRETHS_OF_A_SECOND;

                $info['comment_list'] = array();

                $info['transparency_type'] = eZImageAnalyzer::TRANSPARENCY_OPAQUE;

                // Read Logical Screen Descriptor
                $data = fread( $fd, 7 );
                $offset += 7;

                $lsdFields = ord( $data[4] );

                $globalColorCount = 0;
                $globalColorTableSize = 0;
                if ( $lsdFields >> 7 )
                {
                    $globalColorCount = ( 1 << ( ( $lsdFields & 0x07 ) + 1) );
                    $globalColorTableSize = $globalColorCount * 3;
                }

                $info['color_count'] = $globalColorCount;

                $info['width'] = ( ord( $data[1] ) << 8 ) + ord( $data[0] );
                $info['height'] = ( ord( $data[3] ) << 8 ) + ord( $data[2] );


                if ( $globalColorTableSize )
                {
                    fseek( $fd, $globalColorTableSize, SEEK_CUR );
                    $offset += $globalColorTableSize;
                }
                if ( $printInfo )
                    print( "Global color table size=$globalColorTableSize\n" );

                $done = false;
                while ( !$done )
                {
                    $data = fread( $fd, 1 );
                    $offset += 1;
                    $blockType = ord( $data[0] );
                    if ( $printInfo )
                    {
                        print( "Block type=0x" . dechex( $blockType ) );
                        if ( isset( $blockTypes[$blockType] ) )
                            print( " (" . $blockTypes[$blockType] . ")" );
                        print( "\n" );
                    }
                    if ( $blockType == 0x21 ) // Extension Introducer
                    {
                        $data .= fread( $fd, 1 );
                        $offset += 1;
                        $extensionLabel = ord( $data[1] );
                        if ( $printInfo )
                        {
                            print( "> " . "Extension label=0x" . dechex( $extensionLabel ) );
                            if ( isset( $extensionLabels[$extensionLabel] ) )
                                print( " (" . $extensionLabels[$extensionLabel] . ")" );
                            print( "\n" );
                        }
                        if ( $extensionLabel == 0xf9 ) // Graphical Control Extension
                        {
                            $data = fread( $fd, 5 + 1 );
                            $info['animation_timer'] = ( ord( $data[3] ) << 8 ) + ord( $data[2] );
                            $gceFlags = ord( $data[1] );
                            if ( $gceFlags & 0x01 )
                                $info['transparency_type'] = eZImageAnalyzer::TRANSPARENCY_TRANSPARENT;
                            $offset += 5 + 1;
                        }
                        else if ( $extensionLabel == 0xff ) // Application Extension
                        {
                            $data = fread( $fd, 12 );
                            if ( $printInfo )
                            {
                                $applicationIdentifier = substr( $data, 1, 8 );
                                $applicationAuthentication = substr( $data, 1 + 8, 3 );
                                print( ">> Application identifier: $applicationIdentifier\n" );
                                print( ">> Application authentication: $applicationAuthentication\n" );
                            }
                            $offset += 12;

                            $dataBlockDone = false;
                            while ( !$dataBlockDone )
                            {
                                $data = fread( $fd, 1 );
                                $offset += 1;
                                $blockBytes = ord( $data[0] );
                                if ( $printInfo )
                                    print( ">> Application Block size=$blockBytes\n" );
                                if ( $blockBytes )
                                {
                                    fseek( $fd, $blockBytes, SEEK_CUR );
                                    $offset += $blockBytes;
                                }
                                else
                                {
                                    if ( $printInfo )
                                        print( ">> GIF application blocks terminated by 0 image block\n" );
                                    $dataBlockDone = true;
                                }
                            }
                        }
                        else if ( $extensionLabel == 0xfe ) // Comment Extension
                        {
                            $commentBlockDone = false;
                            $comment = false;
                            while ( !$commentBlockDone )
                            {
                                $data = fread( $fd, 1 );
                                $offset += 1;
                                $blockBytes = ord( $data[0] );
                                if ( $printInfo )
                                    print( ">> Comment Block size=$blockBytes\n" );
                                if ( $blockBytes )
                                {
                                    $data = fread( $fd, $blockBytes );
                                    if ( $printInfo )
                                        print( $data );
                                    $comment .= $data;
                                    $offset += $blockBytes;
                                }
                                else
                                {
                                    if ( $printInfo )
                                        print( ">> GIF comment blocks terminated by 0 image block\n" );
                                    $commentBlockDone = true;
                                }
                            }
                            if ( $comment )
                                $info['comment_list'][] = $comment;
                        }
                        else
                        {
                            if ( $printInfo )
                                print( "> Unknown extension label, aborting\n" );
                            $done = true;
                        }
                    }
                    else if ( $blockType == 0x2c ) // Image Descriptor
                    {
                        $info['frame_count'] += 1;
                        $data .= fread( $fd, 9 );
                        $localColorTableSize = 0;
                        $localColorCount = 0;
                        $idFields = ord( $data[9] );
                        if ( $idFields >> 7 ) // Local Color Table
                        {
                            $localColorCount = ( 1 << ( ( $idFields & 0x07 ) + 1) );
                            $localColorTableSize = $localColorCount * 3;
                        }
                        if ( $localColorCount > $globalColorCount )
                            $info['color_count'] = $localColorCount;

                        if ( $localColorTableSize )
                        {
                            fseek( $fd, $localColorTableSize, SEEK_CUR );
                            $offset += $localColorTableSize;
                        }
                        if ( $printInfo )
                            print( ">> Local color table size=$localColorTableSize\n" );

                        $lzwCodeSize = fread( $fd, 1 ); // LZW Minimum Code Size
                        $offset += 1;

                        $dataBlockDone = false;
                        while ( !$dataBlockDone )
                        {
                            $data = fread( $fd, 1 );
                            $offset += 1;
                            $blockBytes = ord( $data[0] );
                            if ( $printInfo )
                                print( ">> Block size=$blockBytes\n" );
                            if ( $blockBytes )
                            {
                                fseek( $fd, $blockBytes, SEEK_CUR );
                                $offset += $blockBytes;
                            }
                            else
                            {
                                if ( $printInfo )
                                    print( ">> GIF image blocks terminated by 0 image block\n" );
                                $dataBlockDone = true;
                            }
                        }
                    }
                    else if ( $blockType == 0x3b ) // Trailer, end of stream
                    {
                        if ( $printInfo )
                            print( "GIF stream terminated by Trailer block\n" );
                        $done = true;
                    }
                    if ( feof( $fd ) )
                        $done = true;
                }
            }
            else
            {
                if ( $printInfo )
                    print( "Not GIF\n" );
                eZDebug::writeError( "The image file $filename is not a GIF file, cannot analyze it", __METHOD__ );
            }
            fclose( $fd );
            $info['is_animated'] = $info['frame_count'] > 1;
            return $info;
        }
        return false;
    }
892580
function line($x1, $y1, $x2, $y2, $color, $width, $style = null) {
    $this->_set_line_style($width, "butt", "", $style);
    $this->_set_stroke_color($color);

    $y1 = $this->y($y1);
    $y2 = $this->y($y2);

    $this->_pdf->moveto($x1,$y1);
    $this->_pdf->lineto($x2, $y2);
    $this->_pdf->stroke();
  }
611752
function renderPDF(params, cb) {
  var template = params.template;
  var session = params.session;
  var form = params.form;
  var submission = params.submission;
  submission.formName = form.name;
  var studioLocation = params.location;
  var generationTimestamp = params.generationTimestamp || Date.now();

  var page;

  session.createPage()
    .then(function(_page) {
      logger.debug('page created');
      page = _page;
      // A4 aspect ratio
      page.property('paperSize', {format: 'A4'})
        .then(function() {
          logger.debug('page aspect ratio set');

          //Can't load css files over https. Needs to be http.
          if (typeof(studioLocation) === "string") {
            studioLocation = studioLocation.replace("https://", "http://");
          }
          form = processForm(form, submission);
          var html = template({
            form: form.form,
            location: studioLocation,
            subexport: form.sub,
            js: params.js,
            css: params.css
          });

          // inject html as we don't have a server to serve html to phantom
          page.setContent(html, null)
            .then(function(status) {
              logger.debug('content set. status', status);

              var file = path.join(params.pdfExportDir, form.sub.formSubmittedAgainst._id + '_' + form.sub._id + '_' + generationTimestamp + '.pdf');
              page.render(file)
                .then(function() {
                  logger.info('Rendered pdf:', {file: file});
                  page.close();
                  page = null;

                  destroyPhantomSession(session, function() {
                    return cb(null, file);
                  });
                });
            });
        });
    })
    .catch(function(e1) {
      logger.error('Exception rendering pdf', {exception: e1});
      try {
        if (page) {
          page.close();
        }
      } catch (e2) {
        // silent
        logger.warn('Error closing page after phantom exception', {exception: e2});
      }
      return cb('Exception rendering pdf:' + e1.toString());
    });
}
217043
function filledRectangle($x1, $y1, $width, $height)
    {
        $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F re f", $x1, $y1, $width, $height));
    }
1265804
public function rectangle($x, $y, $width, $height, $context, $x, $y, $width, $height)
    {
    }
1158213
protected function _tag_close_DRAW($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        $this->svgDrawer->stopDrawing();


        $this->_maxX = $this->parsingCss->value['old_maxX'];
        $this->_maxY = $this->parsingCss->value['old_maxY'];
        $this->_maxH = $this->parsingCss->value['old_maxH'];

        $marge = array();
        $marge['l'] = $this->parsingCss->value['border']['l']['width'];
        $marge['r'] = $this->parsingCss->value['border']['r']['width'];
        $marge['t'] = $this->parsingCss->value['border']['t']['width'];
        $marge['b'] = $this->parsingCss->value['border']['b']['width'];

        $x = $this->parsingCss->value['x'];
        $y = $this->parsingCss->value['y'];
        $w = $this->parsingCss->value['width']+$marge['l']+$marge['r'];
        $h = $this->parsingCss->value['height']+$marge['t']+$marge['b'];

        if ($this->parsingCss->value['position'] !== 'absolute') {
            $this->pdf->SetXY($x+$w, $y);

            $this->_maxX = max($this->_maxX, $x+$w);
            $this->_maxY = max($this->_maxY, $y+$h);
            $this->_maxH = max($this->_maxH, $h);
            $this->_maxE++;
        } else {
            // position
            $this->pdf->SetXY($this->parsingCss->value['xc'], $this->parsingCss->value['yc']);

            $this->_loadMax();
        }

        $block = ($this->parsingCss->value['display'] !== 'inline' && $this->parsingCss->value['position'] !== 'absolute');

        $this->parsingCss->load();
        $this->parsingCss->fontSet();
        $this->_loadMargin();

        if ($block) {
            $this->_tag_open_BR(array());
        }
        if (!is_null($this->debug)) {
            $this->debug->addStep('DRAW', false);
        }

        return true;
    }
1011855
function callDrawLine( $info )
    {
        $params = array();
        eZPDFTable::extractParameters( $info['p'], 0, $params, true );

        $this->setLineStyle( $params['thickness'] );
        $this->line( $params['x1'], $params['y1'], $params['x2'], $params['y2'] );
    }
966199
def draw_rectangle(x, y, width, height, attr = {})
            last_content_stream.draw_rectangle(x, y, width, height, attr); self
        end
913641
function callFrame( $params, $text )
    {
        if ( strlen( $text ) > 0 )
        {
            $this->addDocSpecFunction( 'ezInsertFrame', array( $this->fixWhitespace( $text ), $params) );
        }
    }
415866
function drawLinearTitle(context, options) {
    if (!options.title) return ;

    let {isVertical, width, length, baseX, baseY, titleMargin} =
        context.barDimensions;
    let textHeight = options.fontTitleSize * width / 200;
    //noinspection JSUnresolvedFunction
    let textX = round(baseX + (isVertical ? width : length) / 2);
    //noinspection JSUnresolvedFunction
    let textY = round(baseY + titleMargin / 2 -
        (isVertical ? textHeight : textHeight / 2) -
        0.025 * (isVertical ? length : width));

    context.save();
    context.textAlign = 'center';
    context.fillStyle = options.colorTitle;
    context.font = drawings.font(options, 'Title', width / 200);
    context.lineWidth = 0;
    context.fillText(options.title, textX, textY, isVertical ? width : length);
}
505526
public function drawRoundedRectangle($x1, $y1, $x2, $y2, $radius, $fillType = \ZendPdf\Page::SHAPE_DRAW_FILL_AND_STROKE)
    {
        $this->convertCoordinatesFromUserSpace($x1, $y1);
        $this->convertCoordinatesFromUserSpace($x2, $y2);
        list($y1, $y2) = array($y2, $y1);
        $this->convertToPoints($radius);
        return parent::drawRoundedRectangle($x1, $y1, $x2, $y2, $radius, $fillType);
    }
785603
function DrawBars() {

    if ($this->data_type != "text-data") {
      $this->DrawError('Bar plots must be text-data: use function SetDataType("text-data")');
    }

    $xadjust = ($this->records_per_group * $this->record_bar_width )/4;

    reset($this->data_values);
    while (list($j, $row) = each($this->data_values)) {

      $color_index = 0;
      $colbarcount = 0;
      $x_now = $this->xtr($j+.5);

      while (list($k, $v) = each($row)) {
        if ($k == 0) {
          //Draw Data Labels
          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
          $this->DrawXDataLabel($xlab,$x_now);
        } else {
          // Draw Bars ($v)
          $x1 = $x_now - $this->data_group_space + ($k-1)*$this->record_bar_width;
          $x2 = $x1 + $this->record_bar_width*$this->bar_width_adjust;

          if ($v < $this->x_axis_position) {
            $y1 = $this->ytr($this->x_axis_position);
            $y2 = $this->ytr($v);
          } else {
            $y1 = $this->ytr($v);
            $y2 = $this->ytr($this->x_axis_position);
          }

          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
          if ($colbarcount >= count($this->ndx_data_border_color)) $colbarcount=0;
          $barcol = $this->ndx_data_color[$color_index];
          $bordercol = $this->ndx_data_border_color[$colbarcount];

          if ((strval($v) != "") ) {   //Allow for missing Y data
            if ($this->shading > 0) {
              for($i=0;$i<($this->shading);$i++) {
              //Shading set in SetDefaultColors
              ImageFilledRectangle($this->img, $x1+$i, $y1-$i, $x2+$i, $y2-$i, $this->ndx_i_light);
              }
            }

            ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $barcol);
            ImageRectangle($this->img, $x1, $y1, $x2, $y2, $bordercol);
            if ($this->draw_data_labels == '1') {  //ajo
              $y1 = $this->ytr($this->label_scale_position * $v);
              //$this->DrawDataLabel($v,$j + .5,$v*$this->label_scale_position);
              $this->DrawText($this->small_font, $this->x_label_angle,
                $x1+$this->record_bar_width/2, $y1, $this->ndx_label_color, $this->x_label_ttffont_size, $v,'center','top');
            }
          }

          $color_index++;
          $colbarcount++;
        }
      }
    }
  }
437604
function triangleDraw(c, params)
{
    const size = params.size
    const half = params.size / 2
    c.beginPath()
    c.fillStyle = '#' + params.color.toString(16)
    c.moveTo(half, 0)
    c.lineTo(0, size)
    c.lineTo(size, size)
    c.closePath()
    c.fill()
    c.fillStyle = 'white'
    c.font = '40px Arial'
    const measure = c.measureText(n)
    c.fillText(n++, size / 2 - measure.width / 2, size / 2 + 10)
}