Curl Global Community

Full Version: Curl equivalent to CSS unicode-range
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone have an idea for a Curl equivalent to CSS unicode-range in font declaration for @font-face ?
My need is to have light hiragana and katakana but more strongly-stroked kanji characters and bold mono radical characters.
I have not been able to find font really suitable to kanji recognition for gai-jin learning nihongo no kanji .
The HTML unicode-range option in declaring a @font-face does permit the intended presentation style.
Thanks
I think it's impossible to declare font of each curl's character object like @font-face...

Code:
{define-class public FontFaceCharGraphic {inherits CharGraphic}

  def first-kanji:int = '亜' asa int
  def last-kanji:int = '腕' asa int

  field char:char

  {constructor public {default c:char, ...  }
    {construct-super c, {splice ...}}
    set self.char = c
    {self.change-style}
  }

  {method {change-style}:void
    def u = self.char asa int
    {if u >= {this-class}.first-kanji  and u <= {this-class}.last-kanji  then
        set self.font-weight = FontWeight.bold
    else
        set self.font-weight = FontWeight.normal
    }
    {output self.c , ":", u}
  }

  {method public {add g:any, ...}:#Visual
    {type-switch value
    case c:char do
        set self.char = c
        {self.change-style}
    }
    {return  {super.add g, {splice ...}}}

  }
}

{define-class public  StringFrame {inherits HBox}
  {constructor public {default str:String}
    {for c in str do
        {self.add {FontFaceCharGraphic c}}
    }
  }
}

{def f = {StringFrame  "fist-kanji:字[ 1-9, a-Z, ()+*, あいうえお 日本] last-kanji:腕"}}

{value f}
I will let you know if this works for me Thanks and keep posting such a informative blogs.