-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support text layers #20
Comments
Hey there. Text layers aren't current supported, but I'd love for them to be supported in The first step would be to check the spec to find out how text is stored. Followed by parsing out the data from the appropriate section. So, it currently isn't possible in |
@chinedufn I've never done something like this, but it seems really interesting. I've actually hit a bit of a snag and wondering you had any suggestions. In the file cursor.read_2()?; // Version
cursor.read(48)?; // Transformation
cursor.read_2()?; // Text version
cursor.read_4()?; // Descriptor version The text version returns From here I get into the actual structure and as it says, I read the unicode string, which seems to be just an empty string, at least in my psd: cursor.read_unicode_string()?; // name from classID After this, I read the classID, this is where I implement a simple yet exact replica of the described method into the cursor: pub fn read_ascii_string(&mut self) -> Result<String, Error> {
let mut length = self.read_u32()?;
if length == 0 {
length = 4;
}
let mut result = String::new();
for _ in 0..length {
let bytes = self.read_u8()?;
result.push(bytes as char);
}
Ok(result)
} cursor.read_ascii_string()?; // classID I've implemented a little past this point, but it seems that when I call Any suggestions on what I could or am doing wrong? |
I'm excited that you're diving in here. I'm more than happy to help wherever I can. Could you make a really simple, small PSD file with a text layer in it and then add it to the fixtures folder Then add a From there, if you can push up your code I can pull it and take a look and see if I notice anything. Thanks for diving into this. I'm glad that it looks like you're close to having it working. |
@chinedufn https://github.com/ok-nick/psd |
Hey. Just a heads up that this is still on my radar but I haven't gotten to it yet. Not sure how time sensitive it is for you. |
I'm trying to access the text data (font/text) from a text layer. Is this currently possible or is it possible to support?
The text was updated successfully, but these errors were encountered: