Coder Social home page Coder Social logo

Comments (7)

drewnoakes avatar drewnoakes commented on May 21, 2024

Does your StartupBanners class include a Development property?

To see generated files you need to set the EmitCompilerGeneratedFiles property in your project:

<PropertyGroup>
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

This will write a file to a location such as obj/Debug/net8.0/generated/MyProject.Lib.Common.

Note that source generators don't write this file by default for performance reasons. The disk IO is avoidable.

from figgle.

HowardShank avatar HowardShank commented on May 21, 2024

Thanks for the quick response.

I do not have that in setting configured. I'll test that tomorrow.

So if the string is generated there, how is it usable as a reference in my source elsewhere? Or is the string just something that you go copy and put in your code where you need it?

from figgle.

drewnoakes avatar drewnoakes commented on May 21, 2024

With the source generator, the output string is computed at compile time, rather than at run time, so it's faster when your program runs (nothing to compute) and you don't need to ship Figgle binaries (which include large font files, embedded).

So your program could resemble this:

[GenerateFiggleTextAttribute("DevelopmentString", "standard", "Development")]
public partial class StartupBanners
{
}

public static class Greeter
{
    public static void PrintDevelopment() => Console.WriteLine(StartupBanners.DevelopmentString);
}

from figgle.

HowardShank avatar HowardShank commented on May 21, 2024

Thank you for your help with this. I appreciate it.

How difficult is it to remove all the fonts except one from the runtime package?

from figgle.

drewnoakes avatar drewnoakes commented on May 21, 2024

It would require some refactoring of the packages I think. You can easily parse a single figlet file using the APIs, but today the core fonts are embedded for convenience.

See #12.

from figgle.

HowardShank avatar HowardShank commented on May 21, 2024

Do you mind if I pull the source and give it a shot?

from figgle.

drewnoakes avatar drewnoakes commented on May 21, 2024

You're welcome to play with it! But if you're hoping to land a change in this repo, I recommend sharing a proposal as to how that might work before submitting a PR. That could save you a bunch of time.

Let's continue the discussion in #12. Looks like the original issue here has been addressed so I'll close this.

from figgle.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.