Skip to content

Commit

Permalink
Merge pull request #48 from bcmcq/firefox-rendering-bug
Browse files Browse the repository at this point in the history
Assign font size as an attribute instead of css on <text>
  • Loading branch information
LasseRafn authored Aug 29, 2020
2 parents 5300a2b + 0e6ee58 commit 1d2d736
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/InitialAvatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,10 @@ protected function makeSvgAvatar() {
// Text
$text = new SVGText( $this->getInitials(), '50%', '50%' );
$text->setFont( new SVGFont( $this->getFontName(), $this->findFontFile() ) );
$text->setSize( $this->getFontSize() * $this->getWidth() );
$text->setStyle( 'line-height', 1 );
$text->setAttribute( 'dy', '.1em' );
$text->setAttribute( 'fill', $this->getColor() );
$text->setAttribute('font-size', $this->getFontSize() * $this->getWidth());
$text->setAttribute( 'text-anchor', 'middle' );
$text->setAttribute( 'dominant-baseline', 'middle' );

Expand Down Expand Up @@ -738,4 +738,4 @@ protected function getFontByScript() {

return $this->getFontFile();
}
}
}

0 comments on commit 1d2d736

Please sign in to comment.