Skip to content

Commit 0e6ee58

Browse files
authored
Assign font size as an attribute instead of css on <text>
1 parent 5300a2b commit 0e6ee58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/InitialAvatar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,10 @@ protected function makeSvgAvatar() {
636636
// Text
637637
$text = new SVGText( $this->getInitials(), '50%', '50%' );
638638
$text->setFont( new SVGFont( $this->getFontName(), $this->findFontFile() ) );
639-
$text->setSize( $this->getFontSize() * $this->getWidth() );
640639
$text->setStyle( 'line-height', 1 );
641640
$text->setAttribute( 'dy', '.1em' );
642641
$text->setAttribute( 'fill', $this->getColor() );
642+
$text->setAttribute('font-size', $this->getFontSize() * $this->getWidth());
643643
$text->setAttribute( 'text-anchor', 'middle' );
644644
$text->setAttribute( 'dominant-baseline', 'middle' );
645645

@@ -738,4 +738,4 @@ protected function getFontByScript() {
738738

739739
return $this->getFontFile();
740740
}
741-
}
741+
}

0 commit comments

Comments
 (0)