treeform / fidget

Figma based UI library for nim, with HTML and OpenGL backends.
MIT License
766 stars 31 forks source link

openglbackend.nim(31, 25) Error: type mismatch: got <Font, seq[Rune], pos: Vec2, size: Vec2, HAlignMode, VAlignMode, clip: bool, boundsMin: Vec2, boundsMax: Vec2> #88

Closed retsyo closed 4 years ago

retsyo commented 4 years ago

I try to compile r:\fidget-0.4.2\examples\minimal\minimal.nim

$ nim
Nim Compiler Version 1.3.5 [Windows: amd64]
Compiled at 2020-06-18
Copyright (c) 2006-2020 by Andreas Rumpf

fldget/opengl/staticglfw/typography are uninstalled via nimble uninstall xx for severval times to confirm that none version of the module is installed then fldget/opengl/staticglfw/typography are installed via nimble uninstall xx

then nim c minimal.nim says

R:\fidget-0.4.2\src\fidget\openglbackend.nim(31, 25) Error: type mismatch: got <Font, seq[Rune], pos: Vec2, size: Vec2, HAlignMode, VAlignMode, clip: bool, boundsMin: Vec2, boundsMax: Vec2>
but expected one of:
proc typeset(font: Font; runes: seq[Rune]; pos: Vec2 = vec2(0, 0);
            size: Vec2 = vec2(0, 0); hAlign: HAlignMode = Left; vAlign: VAlignMode = Top;
            clip = true; tabWidth: float32 = 0.0): seq[GlyphPosition]
  first type mismatch at position: 8
  unknown named parameter: boundsMin
proc typeset(font: Font; text: string; pos: Vec2 = vec2(0, 0); size: Vec2 = vec2(0, 0);
            hAlign: HAlignMode = Left; vAlign: VAlignMode = Top; clip = true;
            tabWidth: float32 = 0.0): seq[GlyphPosition]
  first type mismatch at position: 2
  required type for text: string
  but expression 'toRunes(node.text)' is of type: seq[Rune]

expression: typeset(font, toRunes(node.text), pos = vec2(0, 0), size = size,
        hAlignMode(node.textStyle.textAlignHorizontal),
        vAlignMode(node.textStyle.textAlignVertical), clip = false,
        boundsMin = boundsMin, boundsMax = boundsMax)
treeform commented 4 years ago

Some how your typography is out of date.

image

Last change was 23 days ago.

retsyo commented 4 years ago

no

$ nimble install typography Downloading https://github.com/treeform/typography using git Verifying dependencies for typography@0.3.2 Warning: No nimblemeta.json file found in C:\Users\USER.nimble\pkgs\wxnim-0.8.0 Info: Dependency on flippy@>= 0.4.4 already satisfied Verifying dependencies for flippy@0.4.5 Info: Dependency on vmath@>= 0.1.0 already satisfied Verifying dependencies for vmath@0.3.1 Info: Dependency on chroma@>= 0.0.1 already satisfied Verifying dependencies for chroma@0.1.0 Info: Dependency on print@>= 0.1.0 already satisfied Verifying dependencies for print@0.1.0 Info: Dependency on nimPNG@>= 0.2.6 already satisfied Verifying dependencies for nimPNG@0.2.6 Info: Dependency on snappy@>= 0.1.0 already satisfied Verifying dependencies for snappy@0.1.0 Info: Dependency on vmath@>= 0.3.1 already satisfied Verifying dependencies for vmath@0.3.1 Info: Dependency on chroma@>= 0.0.1 already satisfied Verifying dependencies for chroma@0.1.0 Info: Dependency on print@>= 0.1.0 already satisfied Verifying dependencies for print@0.1.0 Installing typography@0.3.2 Success: typography installed successfully.

$ git clone https://github.com/treeform/fidget Cloning into 'fidget'... remote: Enumerating objects: 239, done. remote: Counting objects: 100% (239/239), done. remote: Compressing objects: 100% (150/150), done. imalReceiving objects: 13% (561/4261), 892.01 KiB | 48.00 KiB/s remote: Total 4261 (delta 110), reused 171 (delta 65), pack-reused 4022 Receiving objects: 100% (4261/4261), 12.11 MiB | 98.00 KiB/s, done. Resolving deltas: 100% (2686/2686), done.

$ cd fidget/examples/minimal

$ nim c -r minimal.nim Hint: used config file 'E:\msys64\home\LOVLJIDY_nim\nim\config\nim.cfg' [Conf] Hint: used config file 'E:\msys64\home\LOVLJIDY_nim\nim\config\config.nims' [Conf] Hint: used config file 'R:\fidget\config.nims' [Conf] Hint: used config file 'R:\fidget\examples\config.nims' [Conf] ..................................................................................... R:\fidget\src\fidget\openglbackend.nim(31, 25) Error: type mismatch: got <Font, seq[Rune], pos: Vec2, size: Vec2, HAlignMode, VAlignMode, clip: bool, boundsMin: Vec2, boundsMax: Vec2> but expected one of: proc typeset(font: Font; runes: seq[Rune]; pos: Vec2 = vec2(0, 0); size: Vec2 = vec2(0, 0); hAlign: HAlignMode = Left; vAlign: VAlignMode = Top; clip = true; tabWidth: float32 = 0.0): seq[GlyphPosition] first type mismatch at position: 8 unknown named parameter: boundsMin proc typeset(font: Font; text: string; pos: Vec2 = vec2(0, 0); size: Vec2 = vec2(0, 0); hAlign: HAlignMode = Left; vAlign: VAlignMode = Top; clip = true; tabWidth: float32 = 0.0): seq[GlyphPosition] first type mismatch at position: 2 required type for text: string but expression 'toRunes(node.text)' is of type: seq[Rune]

expression: typeset(font, toRunes(node.text), pos = vec2(0, 0), size = size, hAlignMode(node.textStyle.textAlignHorizontal), vAlignMode(node.textStyle.textAlignVertical), clip = false, boundsMin = boundsMin, boundsMax = boundsMax)

treeform commented 4 years ago

I think you have fidget installed through nimble as well that is out of date.

try nimble develop in the cloned fidget folder.

Maybe try git clone https://github.com/treeform/typography and nimble develop in that folder too?