Skip to content

Commit

Permalink
Fix font type functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Mar 25, 2024
1 parent 2c3d167 commit 97b635e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.2
4 changes: 2 additions & 2 deletions src/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function getOutCurrentFont(): string
public function isCurrentByteFont(): bool
{
$currentFontType = $this->getCurrentFontType();
return ! (($currentFontType == 'Core') || ($currentFontType == 'TrueType') || ($currentFontType == 'Type1'));
return (($currentFontType == 'Core') || ($currentFontType == 'TrueType') || ($currentFontType == 'Type1'));
}

/**
Expand All @@ -251,7 +251,7 @@ public function isCurrentByteFont(): bool
public function isCurrentUnicodeFont(): bool
{
$currentFontType = $this->getCurrentFontType();
return $currentFontType != 'TrueTypeUnicode' && $currentFontType != 'cidfont0';
return (($currentFontType == 'TrueTypeUnicode') || ($currentFontType == 'cidfont0'));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/StackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ public function testStack(): void
$this->assertEquals('Type1', $type);

$ftype = $stack->isCurrentUnicodeFont();
$this->assertTrue($ftype);
$this->assertFalse($ftype);

$ftype = $stack->isCurrentByteFont();
$this->assertFalse($ftype);
$this->assertTrue($ftype);

$uniarr = [65, 173, 300, 32, 65, 173, 300, 32, 65, 173, 300];
$widths = $stack->getOrdArrDims($uniarr);
Expand Down

0 comments on commit 97b635e

Please sign in to comment.