diff --git a/R/deviceUtils.R b/R/deviceUtils.R index 0b77a1e..f5cd46c 100644 --- a/R/deviceUtils.R +++ b/R/deviceUtils.R @@ -15,7 +15,7 @@ getDocumentPointsize <- function( docString ){ # startps component of the pDevDesc structure. # Search the document declaration for the pointsize. - psLocation <- regexpr( '\\d+[pt]', docString, ignore.case = T, perl = T ) + psLocation <- regexpr( '\\<\\d+pt\\>', docString, ignore.case = T, perl = T ) # If there were no matches, regexpr() returns -1 and this # function returns NA. @@ -27,7 +27,7 @@ getDocumentPointsize <- function( docString ){ # Extract and return the pointsize. pointsize <- substr( docString, psLocation, - psLocation + attr( psLocation, 'match.length') - 2 ) + psLocation + attr( psLocation, 'match.length') - 3 ) return( as.numeric( pointsize ) )