fix wrong git ignore
This commit is contained in:
74
internal/pdf/core/symbols.go
Normal file
74
internal/pdf/core/symbols.go
Normal file
@@ -0,0 +1,74 @@
|
||||
package core
|
||||
|
||||
// IsWhiteSpace checks if byte represents a white space character.
|
||||
// TODO (v3): Unexport.
|
||||
func IsWhiteSpace(ch byte) bool {
|
||||
// Table 1 white-space characters (7.2.2 Character Set)
|
||||
// spaceCharacters := string([]byte{0x00, 0x09, 0x0A, 0x0C, 0x0D, 0x20})
|
||||
if (ch == 0x00) || (ch == 0x09) || (ch == 0x0A) || (ch == 0x0C) || (ch == 0x0D) || (ch == 0x20) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsFloatDigit checks if a character can be a part of a float number string.
|
||||
// TODO (v3): Unexport.
|
||||
func IsFloatDigit(c byte) bool {
|
||||
return ('0' <= c && c <= '9') || c == '.'
|
||||
}
|
||||
|
||||
// IsDecimalDigit checks if the character is a part of a decimal number string.
|
||||
// TODO (v3): Unexport.
|
||||
func IsDecimalDigit(c byte) bool {
|
||||
if c >= '0' && c <= '9' {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// IsOctalDigit checks if a character can be part of an octal digit string.
|
||||
// TODO (v3): Unexport.
|
||||
func IsOctalDigit(c byte) bool {
|
||||
if c >= '0' && c <= '7' {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// IsPrintable checks if a character is printable.
|
||||
// Regular characters that are outside the range EXCLAMATION MARK(21h)
|
||||
// (!) to TILDE (7Eh) (~) should be written using the hexadecimal notation.
|
||||
// TODO (v3): Unexport.
|
||||
func IsPrintable(char byte) bool {
|
||||
if char < 0x21 || char > 0x7E {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// IsDelimiter checks if a character represents a delimiter.
|
||||
// TODO (v3): Unexport.
|
||||
func IsDelimiter(char byte) bool {
|
||||
if char == '(' || char == ')' {
|
||||
return true
|
||||
}
|
||||
if char == '<' || char == '>' {
|
||||
return true
|
||||
}
|
||||
if char == '[' || char == ']' {
|
||||
return true
|
||||
}
|
||||
if char == '{' || char == '}' {
|
||||
return true
|
||||
}
|
||||
if char == '/' {
|
||||
return true
|
||||
}
|
||||
if char == '%' {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user