[Seaside] Aw: Re: FontAwesome update?
astares at gmx.de
Mon Aug 8 21:56:32 UTC 2016
>mmm I may also need to update the fonts methods such as #fontsfontawesomewebfontEotContent in case they changed with latest release...
>Do you recall how to generated those methods? Because we must create the ByteArray thingy out of those svg, ttf, file
As I said:
1. create a temporary package "MyTempPackage", create a simple class "MyTempLib" as subclass of WAFileMetadataLibrary
2. Extract the FontAwesome download into a directory and
MyTempLib recursivelyAddAllFilesIn: 'c:\pathToFontAwesome\'
3. now you have all the resources generated as methods in this temporary class. Now copy or move these methods over to the appropriate:
Put it into
- "FAWDevelopmentLibrary" when the resource is DEVELOPMENT related (for instance #cssfontawesomeCss with #cssfontawesomeCssContent
- "FAWDeploymentLibrary" when the resource is DEPLOYMENT related (minified versions like #cssfontawesomeminCss with #cssfontawesomeminCssContent
If a resource method is necessary for DEVELOPMENT and DEPLOYMENT move/copy it to the common superclass FAWFileLibrary
This is because for easy debugging/development one would choose the FAWDevelopmentLibrary and for later deployment
one would used the FAWDeploymentLibrary which provides the minimized versions.
When are finished moving the methods over and it was already an existing method the Pharo diff tool in Monticello could show you if they
really changed for the new FontAwesome version or stay with the same contents. Mostly all the files (also the fonts) change for an updated
FontAwesome version, havent checked for the latest one.
4. Provide implementation and test methods:
a) In package "FontAwesome-Core" add the necessary extension methods to class "WATagBrush" for the new provided FontAwesome CSS classes
Follow the naming convention and let the method name start with "fontAwesome..."
b) Dont forget to add a testcase for each of the new extension methods
This can be done in package "FontAwesome-Tests-Core-Canvas" in Sunit class "FAWCanvasBrushTest"
5. Check if the example already includes the new stuff, for instance icons will be added automagicaly when following the
naming convention. See FAWExamplesHome>>renderIconsOn: method how this is implemented.
You can also add other examples to the class FAWExamplesHome. Double check that it is working on http://localhost:8080/fontawesome
6. When stable and all tests pass I usually update the ConfiguratonOfFontAwesome and release a new version (also in Catalog)
Thats it. Hope it helps reproducing my steps.
More information about the seaside