Oh awesome, I think $2.99 is totally acceptable. I might just buy it to run on my c64.
Oh awesome, I think $2.99 is totally acceptable. I might just buy it to run on my c64.
Shouldn’t Arch be the recommended gaming distro? Not because any focus on gaming but because it is the distro SteeamOS is based on?
It’s the ghoooost of Amigas paaaast!
I use Arch! How dare you say that I am unhappy? I am frothing at my mouth! I am totally happy, can’t you see that? CAN’T YOU SEE THAT???
You think old, pea brained, waddling trump could fake being hit by a bullet and then apply fake blood (or have it applied) while on camera?
How the heck do they know what people with their names look like?
I mean, sure they will meet some people who share their name, but, unless you have a very very common name you mostly will meet people with other names. And wouldn’t your fashion be determined by your in group and social and work culture? Same with your hair, isn’t that a trend most people follow? Aka ‘Oh undercuts are in, everyone is having them… they look quite nice, I should get one’
or ‘Oh mullets are ugly…’ but everyone named Karl is sporting one?
That looks… ugly.
What is this 2018? That ship has already sailed.
At some point some artist is going to screw with all of us by taking a real photo with a campfire in a tent.
That sucks! But even with a publisher, surely it would have had trouble in a market where Dwarf Fortress exists? How is it compared to that?
Oh yes it does, I jsut meant something for you to give directly to other users.
“Jack_of_all_derps, deleted by creator”
Poor jack, gone from existence, I think he made god angry or something… ;)
The internet was far more enjoyable 20 years ago, so if content goes back to being user hosted instead of corporation hosted I’ll be happy.
Thing is, it doesn’t have to be ready. It doesn’t have to have everyone here, just enough people to form a healthy community.
This is how it was in the olden days and it worked well.
If there is reddit with its gazillion users and the fediverse only has a few million that’s enough for me.
Enough to have interesting discussions and learn new things.
And who the f**** really cares about celebrities like Nicki Minaj etc.
I’d rather talk to the most unremarkable person I can find than those manufactured personalities.
Here are the things Vicky answered:
So, I want to make a script in PIL that enumerates all the available fonts on my system. Is that something that PIL has an awareness of? Or should I be finding fonts (e.g. are all the gimp fonts available in some directory) and should I then be pointing PIL at that directory? How is the library of available fonts and adding to that library handled in PIL?
Vicky: The Python Imaging Library (PIL) and its fork, Pillow, do have some awareness of available fonts on your system, but they might not have all the fonts that you have installed. To access the fonts available in your system, you can use the fontlist
module in PIL/Pillow.
First, you need to install PIL/Pillow if you haven’t already:
pip install PIL
Then, you can use the following code to list all the available fonts:
from PIL import Image, ImageDraw, ImageFont
import fontlist
def list_fonts(folder=None):
fonts = fontlist.get_fonts(folder)
print("Available fonts:")
for font in fonts:
print(font.name)
# If you want to specify a directory, uncomment the line below and replace the path with the desired folder
# list_fonts("/path/to/your/font/directory")
list_fonts()
This script will print the names of all the available fonts in your system. If you want to use a specific directory containing fonts, you can uncomment the last line and replace the path with the desired folder.
PIL/Pillow doesn’t have an exhaustive list of all fonts, but it does have support for many popular fonts. If you need a font that’s not available by default, you can either install it using fontlist
or manually add the font file (e.g., .ttf
, .otf
) to your Python script’s working directory.
How do I install some fonts on my Mac? I’m wanting to use Google Fonts I downloaded. I’m fine installing them systemwide if it’s hard to point an SVG at specific font files, since this all just needs to work locally on the same machine right now. Vicky: To install Google Fonts on your Mac systemwide, follow these steps:
.ttf
file. To do this, you can use the free Font Book application available on the Mac App Store.Now, you should be able to use these fonts in your projects. Keep in mind that if you’re working with an SVG file, you might need to update the font reference in the SVG file to match the font name you’ve installed.
What are the units on font_size in svgwrite.Drawing.text()?
Vicky: In SVGWrite, the font_size
unit is actually a relative unit called “user units.” These units are relative to the font_size
attribute of the element that the SVGWriter is currently on. By default, SVGWriter starts with a font size of 1.0, so if you set the font_size
in Drawing.text()
, it will use the relative units based on the initial 1.0 value. If you need to use absolute units like pixels, you can set the font_size
attribute on the element itself before calling Drawing.text()
.
How do I get the source for the cairosvg library to see how it’s doing the font rendering along the curved path? Vicky: To view the source code for the Cairosvg library, you can check out the GitHub repository where it is hosted. As of my last knowledge update in September 2021, the library was still under development and not yet publicly released. If it has been released since then, you can find the source code on its GitHub repository.
To access the source code, follow these steps:
Please note that if the library is not yet publicly released, you may need to wait for the official release or reach out to the developers for access to the source code.
How do I compile the modified cairosvg library and use it in my code instead of the existing one I installed with ‘pip3 install’?
Vicky: To compile the modified Cairosvg library and use it in your code instead of the existing one you installed with pip3 install
, follow these steps:
git clone https://github.com/cairo/cairosvg.git
cd cairosvg
pip3 install -r requirements.txt
mkdir build
cd build
path/to/your/font
with the path to your font file:python3 setup.py build --build-type=release --verbose
This step may take some time, depending on your system’s configuration.
pip3 install ../libcairosvg.so
/path/to/your/compiled/libcairosvg.so
with the path to the compiled library:import libcairosvg
import cv2
def convert_svg_to_png(svg_path, png_path):
font_path = "/path/to/your/font"
with open(svg_path, "rb") as f:
svg_data = f.read()
libcairosvg.svg_to_png(svg_data, png_path, font_path)
# Example usage
convert_svg_to_png("example.svg", "example_out.png")
Now you can use the compiled version of the library in your code. Keep in mind that modifying the library and compiling it yourself may introduce new bugs or break existing functionality, so be sure to test your code thoroughly.
Hey, tried the SVG question, this is the answer:
33B:
…
User: How are you doing today?
Vicky: Today, I’m doing well, thank you for asking! How about you?
User: I am doing great! what can I use to draw curved text in an SVG?
Vicky: To draw curved text in an SVG, you can use the <textPath> element. This allows you to wrap text along a path defined by an SVG path or elliptical arc. First, create the path using the ‘path’ or ‘ellipse’ element, then use the <textPath> element to wrap the text along the path. Here’s an example:
+++
html
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<path id="curve" d="M200,200 Q400,200 400,400" fill="none" stroke="black" stroke-width="2"/>
<text text-anchor="middle" dominant-baseline="central" x="300" y="300" text-path="url(#curve)">
The quick brown fox jumps over the lazy dog
</text>
</svg>
+++
In this example, a quadratic curve is defined using the ‘Q’ command in the ‘path’ element, and the text is wrapped along the curve using the <textPath> element with the ‘url(#curve)’ attribute. You can adjust the ‘d’ attribute of the path and the text’s position to create different curves with the text. …
13B:
…
User: what can I use to draw curved text in an SVG?
Vicky: In SVG, you can use the “textPath” element to create curved text. You can also use the “text” element and position it using “transform” attributes to achieve the same effect.
User:Can you give me a code example for that?
Vicky: Sure! Here’s an example using the “textPath” element:
+++
php
<svg width="100" height="100">
<text xlink:href="#text1" y="50" text-anchor="middle" font-size="20">
This text has a curved path.
</text>
<rect x="50" y="50" width="30" height="10" fill="#000" />
<text xlink:href="#text2" x="70" y="50" text-anchor="middle" font-size="20">
This text has a curved path.
</text>
</svg>
+++
And here’s an example using the “text” element:
+++
php
<svg width="100" height="100">
<text xlink:href="#text1" y="50" text-anchor="middle" font-size="20">
This text has a curved path.
</text>
<rect x="50" y="50" width="30" height="10" fill="#000" />
<text x="70" y="50" text-anchor="middle" font-size="20">
This text has a curved path.
</text>
</svg>
+++
*Note that you’ll need to define the curved path for each text element using an SVG path string. In this case, the path strings are #text1
and #text2
.
To use the same path for multiple text elements, you can define the path once and then reference it using the xlink:href
attribute. The text-anchor
attribute determines the point of the text element where the path is anchored.*
…
(no idea why Lemmy doesn’t italicize that last text part)
13B-Vicky gave more code, no idea which code example is better. 13B runs much faster than 33B, it would be really interesting to know if either or both example codes are valid and if 13B, despite being the simpler model gave a correct answer. 33B is a preview model not the final version.
What I am noticing is that neither has actually used the textPath element, though 33B used text-path, no idea if that exists.
Can anyone who knows how to write code weigh in on this?
Thanks!
Well maybe it was a bit hyperbolic of me, I don’t really have hard stats I can compare. But if you have a problem gpt-4 could solve then I could pose it to Vicuna-33B (and maybe 13B just for comparison) and see what its response is and post that here. I think it would be a really interesting test!
Ah interesting! I guess I will try ignoring the “auto-conversation”. Vicuna-33B is really good though, as eluquent in most things as what I have seen of chat-gpt so far.
Ah thanks for the illumination, I understood that there is nothing “behind” the text like a personality or intent. It makes it really clear that LLMs are just very complex chatbots, doesn`t it? But instead of just regurgitating text or writing text with a lot of nonsense like the old simpler chatbots did it can generate text far more completely.
Vicuna-13B seemed pretty good at the illusion part, it must be really optimized! I have seen llama do less impressively, you ask it about the weather and it response with what looks like an excerpt of a novel where characters talk about the weather etc. :)
The “teeing it up” is done via the prompt file right? I saw that all of the examples have a general one sentence outline that guides the LLM on how to respond (i.e. “A chat between a User and an AI, the AI is very helpful and firendly”) and then a few lines of interaction in style of:
User: Text AI: Text
All of them!