Jump to content

455 posts in this topic

Recommended Posts

References using #id need the object with that id to be defined before being used because nanosvg doesn't have a forward declaration mechanism, they are just disregarded instead.

 

EDIT: Just for clarification, you are referencing #icon_1_ on line 54 but icon_1_ is not defined until line 161, etc.

Edited by apianti

Share this post


Link to post
Share on other sites
Advertisement
5 hours ago, apianti said:

References using #id need the object with that id to be defined before being used because nanosvg doesn't have a forward declaration mechanism, they are just disregarded instead.

 

EDIT: Just for clarification, you are referencing #icon_1_ on line 54 but icon_1_ is not defined until line 161, etc.

Thanks for notice. It is not exact reason because we have forward declaration mechanism for gradients but only for explicit shapes. Now I see it is not working for symbols.

Will be corrected soon...

 

PS. nsvg__assignGradients() should do the work

PPS. "OSicon os_mac not parsed" is another bug. shape->group is not defined

Share this post


Link to post
Share on other sites
8 hours ago, apianti said:

References using #id need the object with that id to be defined before being used because nanosvg doesn't have a forward declaration mechanism, they are just disregarded instead.

 

EDIT: Just for clarification, you are referencing #icon_1_ on line 54 but icon_1_ is not defined until line 161, etc.

Good spot and thanks for the reminder.

Though this was just a quick hand built test without thought.

 

2 hours ago, Slice said:

Thanks for notice. It is not exact reason because we have forward declaration mechanism for gradients but only for explicit shapes. Now I see it is not working for symbols.

Will be corrected soon...

 

PS. nsvg__assignGradients() should do the work

PPS. "OSicon os_mac not parsed" is another bug. shape->group is not defined

 

Thanks Slice. Working now :)

Share this post


Link to post
Share on other sites
3 hours ago, Slice said:

Thanks for notice. It is not exact reason because we have forward declaration mechanism for gradients but only for explicit shapes. Now I see it is not working for symbols.

Will be corrected soon...

 

PS. nsvg__assignGradients() should do the work

PPS. "OSicon os_mac not parsed" is another bug. shape->group is not defined

 

Only gradients and clip paths have forward declaration but no other object type. Look at nsvg__createGradientLink, nsvg__assignGradients, nsvg__createClipPath, and nsvg__findClipPath... Every object that can have the core attribute id (I think pretty much every element in an SVG can) should be able to be forward declared but the way that nanosvg is designed does not allow for this. The ids should not try to be resolved until after the entire source is parsed but that is only the case for just gradients and clip paths... Everything else is attempted to be resolved when parsed. If you look at nsvg__parseUse, just returns if the id is not found when parsed. The only other ids that are resolved are patterns in nsvg__addShape, but they are also in place and don't resolve unless already defined. I believe there is a problem with ParseSVGIcon, should it not parse the groups recursively and the shapes as well looking for the icon? I think that's why it's not finding that icon even though it is present in the SVG.

 

EDIT: I mean SVGimage->groups and SVGimage->shapes, recursively since they could be any number deep nested inside either of those.

EDIT2: Since the "os_mac" icon is a group under the "OSBadges" group, the groups directly under SVGimage->groups are never used so it can't be found even though its there.

 

 

Edited by apianti

Share this post


Link to post
Share on other sites

It will be better to sort shapes during parsing to keep different queue of shapes for different groups. In this case we can <use xlink:href="#group1"..> we can't with existing codes.

Yes, forward declaration is only for gradients and clips so we have to define symbols at very begin of svg file to be able to use it later.

About os_mac I already resolved the issue.

Share this post


Link to post
Share on other sites

I'm confused, it appears from the code that this is already happening, albeit in a totally weird way. There are two separate linked lists, image->groups and image->shapes. image->groups is a tree hierarchy of groups with shapes, the other is a list of every shape. So what I was proposing would do exactly that, recursively search image->groups first (parents then nexts, or vice versa), then if not found search image->shapes, since we may be looking for the id of a group or shape. Look here and here. Also, nanosvg is a complete mess that really barely does what its supposed to and the design is basically not sustainable for actual usage beyond a simple few paths svg that will be drawn individually. The nsvg__parseUse needs to be modified to just hold a link reference to the id it's looking for and then assign/create the objects after parsing like with gradients. It also does not search for any id that doesn't belong to a symbol or path, which is incorrect, as you stated.

 

EDIT: Also you appear to be directly modifying the linked list for shapes, instead of duplicating the list for rasterization.

Edited by apianti

Share this post


Link to post
Share on other sites

I proposed to exclude shapes from list that already rendered to speedup parsing. Yes, I know it is dangerous because we can't search one shape twice. But I think it will not happen.

I agree it will be better to sort shapes initially making lists by every group but it requires more overthinking.

Share this post


Link to post
Share on other sites

You could maintain a separate list of already rendered shapes, and search that first then or the use element makes no sense, it needs to be able to use shapes multiple times. I am pretty sure that the groups are already sorted, at least from looking at the nanosvg source that's the way it appears to be working but just upside down, the inner most groups point towards the outer most. Truthfully, I really don't think he thought about how to design before he ran into each individual problem then solved them in ways that would not require changing what he'd already done. This resulted in a lot of incorrect behavior.

Share this post


Link to post
Share on other sites

I've been having trouble creating an image using symbols that renders correctly in both Clover and Illustrator. If an image fit together correctly in one, it would fail in another.

 

After some experiments it appears Illustrator requires the size and position of objects to be described when calling a symbol and does not take these from the symbol itself, where as Clover will take these values from the symbol which I believe is what's supposed to happen.

 

So the only way I've managed to get an image to correctly draw in both Clover and Illustrator is to add placement values when calling the symbol.

 

Basic rectangles:
Clover draws boxes correctly, but Illustrator draws all 3 boxes the same size

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
     
<symbol id="SquareYellow">
  <rect style="fill:#FFFFFF;stroke:#E2DD24" x="0" y="0" width="128" height="128"/>
</symbol>
<symbol id="SquareGreen">
  <rect style="fill:#FFFFFF;stroke:#41AD51" x="16.3" y="16.3" width="95.4" height="95.4"/>
</symbol>
<symbol id="SquareRed">
  <rect style="fill:#FFFFFF;stroke:#E84325" x="35.9" y="35.9" width="56.3" height="56.3"/>
</symbol>
<use xlink:href="#SquareYellow"/>
<use xlink:href="#SquareGreen"/>
<use xlink:href="#SquareRed"/>
</svg>


Clover and Illustrator draws boxes correctly:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
     
<symbol id="SquareYellow">
  <rect style="fill:#FFFFFF;stroke:#E2DD24" x="0" y="0" width="128" height="128"/>
</symbol>
<symbol id="SquareGreen">
  <rect style="fill:#FFFFFF;stroke:#41AD51" width="95.4" height="95.4"/>
</symbol>
<symbol id="SquareRed">
  <rect style="fill:#FFFFFF;stroke:#E84325" width="56.3" height="56.3"/>
</symbol>
<use xlink:href="#SquareYellow" width="128" height="128" transform="translate(0,0)"/>
<use xlink:href="#SquareGreen" width="95.4" height="95.4" transform="translate(16.3,16.3)"/>
<use xlink:href="#SquareRed" width="56.3" height="56.3" transform="translate(35.9,35.9)"/>
</svg>


But it gets more complicated with circles. For my BGM_SVG main icon template, I've found I also need to subtract the placement values from the caller from the placement values in the symbol. Which is a pain.

 

See two files:

BGM_Icon_Template_Corrected.svg

BGM_Icon_Template.svg

 

The BGM_Icon_Template_Corrected SVG file now draws correctly in both Clover and Illustrator.

 

Share this post


Link to post
Share on other sites

In this case, illustrator has incorrect behavior. I just tested your first SVG in multiple different applications and it draws three concentric squares inside each other like it should. Illustrator does not. Maybe you might want to open a bug ticket with them, as this is not correct behavior. Attributes should absolutely be copied to the use imported objects, noted by the second SVG still having colors even in illustrator (you could always move the other attributes into the style attribute though) since it's copying the style attribute. The only situation where this is not the case is if you styled them with embedded CSS and were importing from a separate file, it does not import embedded style from the other file. This does not apply if you used an external CSS though. Although you can't currently use an external CSS in clover, or import from external files, so those points are pretty moot.

 

EDIT: The second set of icons is the same bug in illustrator. It appears it's not applying certain attributes to the use imported object, although it should be. https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use

EDIT2: I see why illustrator made this mistake, because it says 

much like cloned template elements in HTML5

template elements only support global attributes. However, the example given right before that clearly shows that all attributes must be copied and it copies some attributes or the elements would not be drawn correctly ever.

EDIT3: This makes it even more evident since they did what you did and expect that it draws correctly. https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol

Edited by apianti

Share this post


Link to post
Share on other sites
18 hours ago, apianti said:

In this case, illustrator has incorrect behavior. I just tested your first SVG in multiple different applications and it draws three concentric squares inside each other like it should. Illustrator does not. Maybe you might want to open a bug ticket with them, as this is not correct behavior.

Yeah. I was surprised when I saw it as I would have thought Illustrator would be the daddy! I am running CC2018 though and have not yet updated to CC2019 so I'll need to check what happens with the most up to date version.

 

18 hours ago, apianti said:

(you could always move the other attributes into the style attribute though) since it's copying the style attribute.

Yeah, thanks for the pointer. I'll need look at that.

 

And thanks for the other notes and links.

 

I'm going to need more time to look more in to individual specifics, but for now I'm posting where I am with the symbol version of BGM_SVG. I've only currently applied it to the OSBadges and Functions. I'll work on it more when I can.

 

BGM_SVG_Symbols.zip

 

Another issue with the way I'm currently using symbols so both Clover and Illustrator show the file correctly is that macOS's quicklook (does it utilise webkit?) doesn't render the file properly. 

 

 

Share this post


Link to post
Share on other sites

Yes, I think quicklook uses webkit as it show same picture as Safari.

For example if you made an svg image with text using embedded SVG font then Safari and quicklook can show it correctly. Not Google Chrome, not IE.

Share this post


Link to post
Share on other sites
2 hours ago, Slice said:

Yes, I think quicklook uses webkit as it show same picture as Safari.

For example if you made an svg image with text using embedded SVG font then Safari and quicklook can show it correctly. Not Google Chrome, not IE.

 

Funny thing about this is that almost every major developer helped to develop webkit, including adobe and google, google still has the most number of commits in webkit but uses a forked version of their own called blink since a certain version of chrome (28? 29?). I think only apple uses the original webkit now. Yeah, embedded fonts work in almost nothing, but if you move them to a separate svg and use the @font-family syntax for css then it works, lol.

Share this post


Link to post
Share on other sites

Oh I already knew it didn't work in chrome.... In fact as far as I can tell it only works in apps that ship with apple products, so new webkit-based apps. I bet older versions do not work though...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

Announcements

  • Similar Content

    • By le332313
      Can someone share the dell 5593/5493 EFI ? I try to fit the graphics driver, but it not working please help me thanks
       
    • By MaLd0n
      -OpenCore Vanilla TUTORIAL-
       
       
      -USB Port Mapping TUTORIAL-
       
        1 -Create a USB bootable
       
      Create your usb installer, use this tool and download Catalina or Big Sur from Apple servers
       
      Catalina
      installScript_allfullapp.zip
       
      Big Sur
      installScript_1016fullapp.zip
       
      Credits: crazybirdy
       
      Copy Catalina / Big Sur installer to Applications folder, open terminal and run
       
      Catalina
       
       
      Big Sur
       
       
      If you want check one step by step, check here
       
      -Opencore Vanilla Tutorial
      https://tinyurl.com/ycvcnp8h
       
      2- EFI folder USB installation
       
      -EFI OpenCore Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition in your USB STICK
      https://tinyurl.com/ybwr9kq3
       
      -EFI Clover Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition in your USB STICK
      https://tinyurl.com/yxsw7d3t
       
      3- EFI folder SSD
       
      -EFI OpenCore Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition SSD 
      https://tinyurl.com/ybwr9kq3
       
      -EFI Clover Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition SSD
      https://tinyurl.com/yxsw7d3t
       
      4- Start Fine Tune
       
      Run this app and post full dump here for full ACPI solution
       
      RunMe.app
      https://tinyurl.com/y9562hz7
       
       
      If you like a SSDT way, here we go
      SSDT-OLARILA.aml.zip
       
      5- USB Solution
       
      Use these kexts, enable XHCI port limit patch
       
      USB INTEL SERIE 400.zip
       
      and follow this tutorial for remap USB ports
       
       
      --DSDT PATCHES--
       
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS -XHCI -PLUGIN TYPE -HDEF -ARTC -IPIC -TIMR -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -kUSBCompanionIndex -io-device-location -IMEI -EC -PNLF -ARPT -GFX0 -NVME -ACPI-WAKE-GPE -DTGP -HDMI / HDAU  
      --SCREENSHOTS--































      -If you want to buy me a beer - Donations with PayPal
      https://tinyurl.com/r2bvzm7
       
      Big Thanks to XLR and your Badass Motherboard, Ultrafast CPU, Coolest Heatsink, Huge Graphics Card, Tonnes of RAM,
      Gigantic Hard Drive, Lightspeed Disk Burner, Professional Sound Card, Massive LCD Display.
       
       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!

      We're all here to have fun and learn from each other!
    • By Nomade
      Hello All,
       
      It's been a while that I am trying to update my system to 10.15.16.
      The install seem to start, then at reboot time I only see the Normal boot and the Recovery option from the Clover boot menu.
      None of those 2 allow to complete the update.
       
      Is there any ways to force it to install and/or show the "Update" option on the Clover boot screen?
       
      PS: I'm using Z97-Gaming-3
    • By Damx
      The specs CPU: Intel® Core™ i3 Processor 8130U, 2.20 GHz (Kaby Lake Refresh) Chipset: Intel® 300 Series Graphics: Intel® UHD Graphics 620 Display: 21.5'' 1920x1200 RAM: DDR4 PC2400 4GB SSD1: M.2 PLEXTOR (with original Windows 10) SSD2: SATA SAMSUNG 850 EVO (for macOS) Sound: Realtek ALC269 WiFi / BT: Intel 3168 NGW Realtek Card-reader  
       
      Not working
      WiFi: Intel 3168 NGW Realtek Card-reader  
       
      Pre-Installation
       
      I will not go through the basics since it is explained in details here on this site. Briefly, the process is to:
      Get Clover Get Catalina macOS installer Create USB with 2 MBR partitions (FAT32 for Clover and HFS+J for the installer)  
       
      Required kexts
      AppleALC.kext Lilu.kext RealtekRTL8111.kext VirtualSMC.kext WhateverGreen.kext  
       
      Config.plist
      I used the one provided by RehabMan called config_HD615_620_630_640_650.plist. Download it from GitHub. It has almost everything you will need with only few edits for audio.
      Edits:
      [CPU] Make sure there is lilcpu=9 setting in boot arguments needed for Kaby Lake R CPU to be recognised correctly. [GPU] Make sure there is a patch GFX0 to IGPU under ACPI->DSDT [GPU] Under Devices->Properties->PciRoot(0)/Pci(0x02,0) make sure that the AAPL,ig-platform-id value is 00001B59, and the device-id value is 16590000 [AUDIO] Under Devices->Properties->PciRoot(0)/Pci(0x1f,3) set the layout-id to 40 and the device-id to 70A10000 [SMBIOS] Set Mac model ID is iMac19,2  

       

       
      Notes
      For some reason with latest version of Clover the install partition was not visible. If you run into the same issue you can downgrade Clover to r5103, which worked perfectly. WiFi / BT Intel 3168 NGW needs to be replaced if one needs WiFi. Someone mentioned that to get HDMI work properly you may need to change AAPL,ig-platform-id value to 00001659 for PciRoot(0)/Pci(0x02,0) - not my case but may be considered if you get this issue. Don't forget to generate your serial and other SMBUS values before signing in with iCloud services.  
       
    • By MaLd0n
      A very custom DSDT for best experience under macOS. Removed all unused devices, injected all Apple devices, essentials, cosmetics, real improvements. 
       
      -OpenCore Vanilla TUTORIAL-
       
       
      -USB Port Mapping TUTORIAL-
       
          -Original DSDT have 167,880 lines and 762kb
       
      DSDT ORIGINAL.aml.zip138.01 kB · 8 downloads
       
      -Patched DSDT have 30,912 lines and 111kb
       
      DSDT PATCHED.aml.zip27.01 kB · 17 downloads
       
      --Hardware--
      Asus ROG RAMPAGE VI EXTREME OMEGA

      Processor  Intel i9-10980XE

      GPU Radeon RX 5700 XT

      --DSDT Patches--
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS -XHCI -PLUGIN TYPE -HDEF -ARTC -IPIC -TIMR -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -XSPI -EC -PNLF -ARPT -GFX0 -NVME  
      --Screenshots-



















       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!

      We're all here to have fun and learn from each other!
×