예제 #1
0
    protected function typesetChord(Chord $chord)
    {
        $chordHtml = htmlspecialchars($chord->getChord());
        $cssClass = 'chordanchor';
        if ($chord->isBound()) {
            $cssClass .= ' bound';
        }
        if ($chord->hasLeftMargin()) {
            $cssClass .= ' prepend';
        }
        if ($chord->hasRightMargin()) {
            $cssClass .= ' append';
        }
        $this->output[] = <<<EOD
<span class="{$cssClass}"><span data-chord="{$chordHtml}"></span></span>
EOD;
        return $this;
    }
예제 #2
0
파일: TypesetPdf.php 프로젝트: ludviki/tlac
 protected function typesetChord(Chord $chord)
 {
     if ($chord->hasLeftMargin()) {
         $this->typesetMargin();
     }
     $x = $this->pdf->GetX();
     $y = $this->pdf->GetY();
     $dy = $this->pdf->getAbsFontMeasure(800);
     // why not 1000?
     $this->pdf->SetY($y - $dy, false, false);
     // special chord style
     $buffer = $this->currentFont;
     $this->setFont('chord');
     $this->pdf->write(1, $chord->getChord(), '', false, 'justify', false, 0, false, false, 0, 0, '');
     $this->setFont($buffer);
     $this->pdf->SetY($y, false, false);
     if ($chord->isBound()) {
         $this->pdf->SetX($x);
     } else {
         if ($chord->hasRightMargin()) {
             $this->typesetMargin();
         }
     }
 }