Re: Constructing text with astericks

2018-06-01 Thread Kagamin via Digitalmars-d-learn
I don't think bitmaps are a good idea, keep your font in text format with characters indexed by code unit: immutable string[][] font=[ ... [ //'i' "*", "*", "*", "*", "*"], ... [ //'s' "*", "*", "*", "*", "*"], ... ];

Re: Constructing text with astericks

2018-05-31 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 31 May 2018 at 16:05:40 UTC, aberba wrote: That doesn't sound like a trivial thing to do. Ha ha Oh, it isn't that bad if you can get a font as an image file (and have the code to load such image files... but I do!) Take a look at my little answer (SPOILERS THOUGH! Maybe skip to

Re: Constructing text with astericks

2018-05-31 Thread aberba via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 23:11:06 UTC, Adam D. Ruppe wrote: On Wednesday, 30 May 2018 at 22:57:06 UTC, aberba wrote: How will you approach this problem in D idiomatically? Well, I never bother with "idiomatically", so I can't speak to that, but a simple solution that would work is to

Re: Constructing text with astericks

2018-05-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 22:57:06 UTC, aberba wrote: How will you approach this problem in D idiomatically? Well, I never bother with "idiomatically", so I can't speak to that, but a simple solution that would work is to realize that what you're basically asking for here is a bitmap.

Re: Constructing text with astericks

2018-05-30 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 22:57:06 UTC, aberba wrote: I've been given a challenge to write texts using asterisks to form the letters. D happen to have an unlimited amount of idioms yet i'm out out ideas as to the simplest approach. Task is to basically take a piece of text and write them as