Saved styles only save font size sometimes

User avatar
Hoist
Posts: 8
Joined: Sun Mar 01, 2020 1:01 pm
Platform: Windows

Sun Jun 28, 2020 5:24 pm Post

Saved styles only save font size sometimes

Set your style to font size 10. Load you project a day later use your style. Style now makes everything size 14.
Choo-bap choo-waaa!

User avatar
xiamenese
Posts: 4367
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Sun Jun 28, 2020 10:32 pm Post

This should be in the Beta testing forum.

:)
The Scrivenato sometimes known as Mr X.
iMac 27" (late 2015) 10.15.4, 24GB RAM, 512GB SSID
MBP17" (late 2011) 10.13.6, 16GB RAM, 2TB SSID
2017 iPad, iPadOS 13.3, 128GB, Apple Pencil
Scrivener, Scapple, Nisus Writer Pro, Bookends …

User avatar
AmberV
Posts: 24270
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Mon Jun 29, 2020 5:53 pm Post

Moderator Note: moved to beta testing board.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

EM
EMPisek
Posts: 160
Joined: Sat Jun 02, 2018 2:05 pm
Platform: Windows

Mon Jun 29, 2020 10:04 pm Post

Strange as it may sound have you tried rebuilding the database?
:arrow: I'm not just a tester,.. I'm a user :!:

User avatar
Hoist
Posts: 8
Joined: Sun Mar 01, 2020 1:01 pm
Platform: Windows

Tue Jun 30, 2020 7:10 pm Post

Thanks for moving it.

I have not tried rebuilding the database, yes it sounds strange :P

Searched in the manual for it rebuild database but no hits, Looked through the menu items and the only thing i found that was similar was the save and rebuild search indexes so i tried that is that the correct thing to do?
Choo-bap choo-waaa!

User avatar
AmberV
Posts: 24270
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Thu Jul 02, 2020 3:10 pm Post

I am not sure what they are talking about, either. There is no database in Scrivener to rebuild, for one thing, and no indexing or other systems that would need to be rebuilt in relation to styles. The only thing that can be rebuilt, and sometimes needs to be, is the search index. Nothing to do with styles though and there is no reason to do that unless you suspect the project search index is out of sync with the content.

As for the bug itself, I think I’m going to need a more precise information to see exactly what you are. Here is what I tried at any rate:

  1. Create a new blank project and paste in some junk plain-text to work with.
  2. Select some words out of the text and set the font size to 10pt (from 12pt).
  3. Use the Format ▸ Styles ▸ New Style from Selection... command, with the following settings:

    • Name: Test
    • Formatting: Save character attributes
    • Include font family: (yes)
    • Include font size: (yes)
    • (The rest left default).
  4. Quit Scrivener.
  5. Reload project, select some text, and use the Format Bar dropdown to set the style to “Test”. This works fine, the text is 10pt.
  6. Reboot the PC, and upon logging in, manually bump the date to tomorrow. (I can’t imagine the calendar date matters one bit, but maybe some of these other things I’m doing such as rebooting are the real trigger?)
  7. Run step (5), and again I get 10pt.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

rw
rwfranz
Posts: 925
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Fri Jul 03, 2020 5:03 am Post

Hoist wrote:Saved styles only save font size sometimes

Set your style to font size 10. Load you project a day later use your style. Style now makes everything size 14.


Like Amber, I'm wondering what you've done to create the problem, so I'm digressing a bit to discuss the normal ways this is done...

There are a few ways to set a style. The easiest, by far, is to set a line or a paragraph to the font size and format you want, and create a style from it (Menu: Format - Style - New Style from Selection). If you want a named style that goes in the Editor Formatting bar in the Style dropdown box, this is how you do it (there may be another way, but this is the easiest way I know).

A thing to remember, though: if you use an old Style name, Scrivener does not update the rest of the text that's using that named Style. You have to do that; Scrivener does not know what you want. So if I have text named "Centered Text" at 14 points, and I select a line of it, change it to 8 points, "create a new style from selection" and name it "Centered Text" -- the rest of the text that's "Centered Text" on that page will not be updated to the new style until you do it yourself. If you "Redefine style from selection", Scrivener will attempt to update it (if you tell it to), but it may not be successful (Just tried this with "centered text", actually, and it did not update the other text. I think I know why, but I'm waiting for someone else to tell me that one).

Second way is to set "No Style" to a different format (File - Options (F12) - Editing - Formatting, then choose your "no style" preferences). This will change the default formatting of every New Document you create from then on (unless you choose a different format for the project; see below). It does not change the documents you already have, that you did before.

Third way is to set the Project's default formatting, which overrides the standard default formatting. Project - Project Settings - Formatting (5th line down the left side of the box) - "[] Use a different formatting for new documents in this project". If you check this box, and set the formatting information below it, that's what will happen; Scrivener will ignore your nice, neat default style and use this one instead. And, again, it will ONLY affect new documents you create. The old ones remain as they are unless you specifically change them.

Some settings are "scrivener-wide;" that is, they are used no matter what project you load. "No Style" is one of those. If you change it in one project, it'll be changed in every project. So if your project writing a children's reading book is set to 14 point Garamond, and you've got that set as "No Style", your project citing legalese constantly is also going to be set in that from that point forward -- which is why the Project-only formatting exists (that's project-wide, not Scrivener-wide). And, yes, I've been caught by this one before. Thought I'd set "No Style" to 12 points, didn't realize that setting was used for EVERY project. Not sure if this is what you've run into, but it kind of sounds like maybe.

Otoh, you may have found something new... Some new way to bollix up Scrivener... Some new way to torment the programmers...

Still curious as to what you did here; with the information given, I can't duplicate the issue.
Just another user.

User avatar
Hoist
Posts: 8
Joined: Sun Mar 01, 2020 1:01 pm
Platform: Windows

Tue Jul 28, 2020 4:48 pm Post

Here's a video of it.

https://youtu.be/yDQvStFC7cQ

In al earlier session i saved the style(font size 10) and it worked fine.

Now as can be seen in the video the font size changes when i switch between a line where i used the style already and an empty line where the size is 14.
Choo-bap choo-waaa!

rw
rwfranz
Posts: 925
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Wed Jul 29, 2020 4:17 am Post

Hoist wrote:Here's a video of it.

https://youtu.be/yDQvStFC7cQ

In al earlier session i saved the style(font size 10) and it worked fine.

Now as can be seen in the video the font size changes when i switch between a line where i used the style already and an empty line where the size is 14.


Okay, I see what you're doing. Not sure this is a bug, but it might be. If you're holding Ctrl-shift while you move the text, that will cause the text to assume the formatting or style of the line in which it's pasted. In fact, that looks like what's happening. If you're not holding ctrl+shift while you're moving or copying the text, it's a bug. I can't reproduce it, though. If you're not... does this happen with every project or just this one? Is this project relatively old (i.e., made with a prior beta, or perhaps originally converted from v 1.9.x)?
Just another user.

User avatar
Hoist
Posts: 8
Joined: Sun Mar 01, 2020 1:01 pm
Platform: Windows

Wed Jul 29, 2020 8:31 am Post

I'm not holding down ctrl shift.

The project was started in an earlier beta. Ijust know that it worked fine and then it stopped working.
It possible this is because of something going wrong when betas updating i suppose. I can try creating a new project later today and trying it out if i have time. Being on vacation apparently means less freetime ;)
Choo-bap choo-waaa!

User avatar
AmberV
Posts: 24270
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Wed Jul 29, 2020 6:37 pm Post

I can’t really explain how you are getting the result you are, but I don’t think it’s a problem with the style itself losing its settings.

There is an important thing to be aware of, and that is that Scrivener, like just about every program with stylesheets out there, is not strictly semantic. It does not rigidly enforce formatting of text based on its style assignment, and rather allows you to freely change the formatting of any selection of text to something that may look nothing like the style at all.

In other words, it is perfectly valid to have a line (or even part of a line) that is 14pt even though the style is 10pt.

What is a bit odd though is that this kind of, what we call “direct formatting”, should not be persisting on empty lines. The editor should be cleaning up after itself if you leave a line empty, by removing unused formatting commands. It seems in your case that isn’t happening. Maybe these lines are not technically empty and only look that way on the surface. Maybe there is a space in them, I don’t know.

It isn’t normal behaviour though, and I can’t reproduce it myself with a simple test. Here is what I would try:

  1. Select the entirety of the body text.
  2. Hit Ctrl+X to cut it.
  3. Ensure the current line is formatted correctly. First remove any styles on it, and check the settings on the Format Bar.
  4. Press Shift+Ctrl+V to paste.
  5. Apply the style.

You shouldn’t normally have to do all of that. If you want to clear direct formatting, you could normally select the text, use the “No Style” command, and then apply the intended style.

By the way, the core program design works better without a “body text” style (i.e. to be automatically useful to those that never want to learn how to use styles). While it should work fine (with extra configuration and learning, to be clear), it could be that working that way is making things more complicated here than they need to be. You can read more about it in the user manual, in the introductory text to style usage, §15.6.1, Think Different.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

rw
rwfranz
Posts: 925
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Thu Jul 30, 2020 4:06 am Post

Hoist wrote:I'm not holding down ctrl shift.

The project was started in an earlier beta. Ijust know that it worked fine and then it stopped working.
It possible this is because of something going wrong when betas updating i suppose. I can try creating a new project later today and trying it out if i have time. Being on vacation apparently means less freetime ;)


Everything AmberV said is quite true. If this 10 point style is the style you favor for most projects, I'd make it the "No Style" style (the default formatting). You can use File - Options (or F12 to do both of those) - Editing; Formatting tab. There you can set the default tabs, default font and size, and a few other things.

However, if this is from a prior Beta -- that could be causing issues itself. I don't know why. Nobody has ever had an answer for the problem. Also, if the document is fairly old, it can... lose things. Or gain things. Have formatting issues, et cetera. Not sure why. Several ways to solve this, but basically, they boil down to copying your entire binder into a brand new project. If you have nothing in the binder but your manuscript, just copy the manuscript. This forces Scrivener to build new text files and index them in a new .scrivx file. This may help, or it may not. But it seems to be generally successful in halting "strange" behavior (if Scriverner is acting strange, and not the way others report, for example).

I usually open the problem project (this only happens occasionally, but often enough to be a procedure by now), put the cursor in the binder, select all, open a new project, drag and drop the old binder into the new one, and rearrange folders in the new one (you don't need 2 research folders, for example. It won't hurt (i think), but you really only need one). Alternatively, you may import the old project into a new one (simpler, and does just about the same thing).

Not sure that'll help, but it might.
Just another user.

User avatar
Hoist
Posts: 8
Joined: Sun Mar 01, 2020 1:01 pm
Platform: Windows

Tue Aug 04, 2020 11:43 pm Post

Yeh tried on a new project and styles work as expected there so i guess i have to try what rwfranz suggested
Choo-bap choo-waaa!