github.com/signintech/pdft@v0.5.0/minigopdf/font_option.go (about)

     1  package gopdf
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  // Regular - font style regular
     8  const Regular = 0 //000000
     9  // Italic - font style italic
    10  const Italic = 1 //000001
    11  // Bold - font style bold
    12  const Bold = 2 //000010
    13  // Underline - font style underline
    14  const Underline = 4 //000100
    15  
    16  func getConvertedStyle(fontStyle string) (style int) {
    17  	fontStyle = strings.ToUpper(fontStyle)
    18  	if strings.Contains(fontStyle, "B") {
    19  		style = style | Bold
    20  	}
    21  	if strings.Contains(fontStyle, "I") {
    22  		style = style | Italic
    23  	}
    24  	if strings.Contains(fontStyle, "U") {
    25  		style = style | Underline
    26  	}
    27  	return
    28  }